/* ==========================================================================
   Cognition and Sensorimotor Integration Lab — University of Pittsburgh
   Editorial/academic system with Pitt brand accents.
   Hand-authored CSS: no build step, no CDN, safe to drop on static hosting.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700&family=Inter:wght@400;500;600;700&display=swap');

/* --- tokens ------------------------------------------------------------- */
:root {
  --paper:      #fbfaf7;
  --paper-2:    #f4f2ec;
  --surface:    #ffffff;

  --ink:        #12171f;
  --ink-2:      #4a5666;
  --ink-3:      #68717f;   /* 4.73:1 on paper — passes AA at citation sizes */

  --navy:       #003594;   /* Pitt navy  */
  --navy-700:   #002a75;
  --navy-900:   #001b4d;
  --gold:       #ffb81c;   /* Pitt gold  */
  --gold-deep:  #8f6200;   /* 5.14:1 on paper — the eyebrow is 12px, not large text */

  --rule:       rgba(0, 53, 148, 0.13);
  --rule-soft:  rgba(0, 53, 148, 0.07);
  --tint:       rgba(0, 53, 148, 0.04);

  /* layered, navy-tinted elevation */
  --lift-1: 0 1px 2px rgba(0, 27, 77, 0.05), 0 2px 6px rgba(0, 27, 77, 0.04);
  --lift-2: 0 2px 4px rgba(0, 27, 77, 0.06), 0 8px 20px rgba(0, 27, 77, 0.07);
  --lift-3: 0 4px 8px rgba(0, 27, 77, 0.07), 0 18px 44px rgba(0, 27, 77, 0.10);

  --display: 'Fraunces', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;

  /* 4pt spacing rhythm */
  --s1: 0.25rem; --s2: 0.5rem;  --s3: 0.75rem; --s4: 1rem;
  --s5: 1.5rem;  --s6: 2rem;    --s7: 3rem;    --s8: 4rem;    --s9: 6rem;

  --wrap: 68rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* --- reset -------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.7 var(--sans);
  font-feature-settings: 'kern' 1, 'liga' 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--navy); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
h1, h2, h3, h4 { margin: 0; font-family: var(--display); font-weight: 600; line-height: 1.14; letter-spacing: -0.02em; }
p { margin: 0 0 var(--s4); }
ul { margin: 0; padding: 0; }

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

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

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--navy); color: #fff; padding: var(--s3) var(--s4);
  font: 600 15px/1 var(--sans); border-radius: 0 0 6px 0;
}
.skip:focus { left: 0; }

/* --- header ------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(251, 250, 247, 0.88);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--rule);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s5); flex-wrap: wrap; padding-top: var(--s3); padding-bottom: var(--s3);
}

.brand { display: flex; align-items: center; gap: var(--s3); text-decoration: none; color: inherit; }
.brand:hover .brand-name { color: var(--navy); }
.brand-mark {
  width: 38px; height: 38px; flex: none; border-radius: 7px;
  background: var(--navy); color: #fff;
  display: grid; place-items: center;
  font: 700 13px/1 var(--sans); letter-spacing: 0.06em;
  box-shadow: var(--lift-1);
}
.brand-mark span { transform: translateY(0.5px); }
.brand-name {
  font-family: var(--display); font-weight: 600; font-size: 17px;
  line-height: 1.2; letter-spacing: -0.015em;
  transition: color 180ms var(--ease);
}
.brand-sub {
  display: block; font-family: var(--sans); font-weight: 500;
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-3); margin-top: 2px;
}

.nav { display: flex; align-items: center; gap: var(--s1); list-style: none; flex-wrap: wrap; }
.nav a {
  display: block; position: relative;
  padding: 10px var(--s3); min-height: 44px; line-height: 24px;
  font: 500 15px/24px var(--sans); color: var(--ink-2);
  text-decoration: none; border-radius: 6px;
  transition: color 180ms var(--ease), background-color 180ms var(--ease);
  touch-action: manipulation;
}
.nav a::after {
  content: ''; position: absolute; left: var(--s3); right: var(--s3); bottom: 6px;
  height: 2px; background: var(--gold);
  transform: scaleX(0); transform-origin: left; border-radius: 2px;
  transition: transform 220ms var(--ease);
}
.nav a:hover { color: var(--ink); background: var(--tint); }
.nav a:hover::after { transform: scaleX(1); }
.nav a:active { transform: translateY(1px); }
.nav a[aria-current='page'] { color: var(--navy); font-weight: 600; }
.nav a[aria-current='page']::after { transform: scaleX(1); }

/* The header wraps to two rows on narrow screens. Sticking a ~150px bar to the
   top of a phone eats a fifth of the viewport, so let it scroll away instead. */
@media (max-width: 699px) {
  .site-header { position: static; }
  .year-head { top: 0 !important; }
  .brand-name { font-size: 15px; }
  .site-header .wrap { gap: var(--s2); }
  .hero > .wrap { padding-top: var(--s7); padding-bottom: var(--s6); }
  .section { padding: var(--s7) 0; }
}

/* --- hero --------------------------------------------------------------- */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--rule); }
.hero::before {
  content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(60rem 34rem at 12% -10%, rgba(0, 53, 148, 0.10), transparent 62%),
    radial-gradient(42rem 30rem at 92% 8%,  rgba(255, 184, 28, 0.16), transparent 60%),
    radial-gradient(36rem 26rem at 60% 108%, rgba(0, 53, 148, 0.06), transparent 65%);
}
.hero::after {
  content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.045'/%3E%3C/svg%3E");
}
.hero > .wrap { position: relative; z-index: 1; padding-top: var(--s9); padding-bottom: var(--s8); }

.eyebrow {
  display: inline-flex; align-items: center; gap: var(--s2);
  font: 600 12px/1 var(--sans); letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--gold-deep); margin-bottom: var(--s5);
}
.eyebrow::before { content: ''; width: 24px; height: 2px; background: var(--gold); border-radius: 2px; }

h1 { font-size: clamp(2.35rem, 6.2vw, 4rem); letter-spacing: -0.032em; max-width: 18ch; }
.lede {
  font-size: clamp(1.06rem, 2vw, 1.28rem); line-height: 1.62;
  color: var(--ink-2); max-width: 60ch; margin-top: var(--s5);
}

/* --- sections ----------------------------------------------------------- */
main { display: block; }
.section { padding: var(--s8) 0; border-bottom: 1px solid var(--rule-soft); }
.section:last-of-type { border-bottom: 0; }
.section-head { max-width: 62ch; margin-bottom: var(--s7); }
h2 { font-size: clamp(1.65rem, 3.4vw, 2.35rem); letter-spacing: -0.025em; }
h3 { font-size: 1.16rem; letter-spacing: -0.015em; }
.prose p { max-width: 68ch; color: var(--ink-2); }
.prose strong { color: var(--ink); font-weight: 600; }

/* --- topic cards -------------------------------------------------------- */
.grid { display: grid; gap: var(--s5); grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid.cols-2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .grid.cols-3 { grid-template-columns: repeat(3, 1fr); } }

.card {
  position: relative; background: var(--surface);
  border: 1px solid var(--rule); border-radius: 12px;
  padding: var(--s5); box-shadow: var(--lift-1);
  transition: transform 240ms var(--ease), box-shadow 240ms var(--ease);
}
.card:hover { transform: translateY(-3px); box-shadow: var(--lift-2); }
.card-num {
  font: 600 12px/1 var(--sans); letter-spacing: 0.12em;
  color: var(--navy); opacity: 0.55; display: block; margin-bottom: var(--s3);
}
.card h3 { margin-bottom: var(--s2); }
.card p { font-size: 0.95rem; color: var(--ink-2); margin: 0; line-height: 1.65; }

/* --- figure ------------------------------------------------------------- */
.figure { position: relative; border-radius: 14px; overflow: hidden; box-shadow: var(--lift-3); }
.figure img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.figure::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0, 27, 77, 0.55), rgba(0, 27, 77, 0) 55%);
}
.figure figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 1;
  padding: var(--s5); color: #fff;
  font-size: 0.92rem; line-height: 1.55;
  text-shadow: 0 1px 3px rgba(0, 27, 77, 0.5);
}

/* --- people ------------------------------------------------------------- */
.people { list-style: none; display: grid; gap: var(--s6); }
.person {
  display: grid; gap: var(--s5); align-items: start;
  grid-template-columns: 1fr;
  padding-bottom: var(--s6); border-bottom: 1px solid var(--rule-soft);
}
.person:last-child { border-bottom: 0; padding-bottom: 0; }
@media (min-width: 700px) { .person { grid-template-columns: 200px 1fr; gap: var(--s6); } }

.person-photo {
  width: 168px; aspect-ratio: 1; border-radius: 50%; object-fit: cover;
  border: 3px solid var(--surface); box-shadow: var(--lift-2);
  background: var(--paper-2);
}
.person.is-pi .person-photo { border-color: var(--gold); }
.person h3 { font-size: 1.45rem; margin-bottom: var(--s2); }
.person .role {
  font: 500 13px/1.5 var(--sans); letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--navy); margin-bottom: var(--s1);
}
.person .affil { font-size: 0.9rem; color: var(--ink-3); margin-bottom: var(--s4); }
.person .bio { color: var(--ink-2); max-width: 62ch; margin-bottom: var(--s4); }

.contact-row { display: flex; flex-wrap: wrap; gap: var(--s2); }
.contact-link {
  display: inline-flex; align-items: center; gap: var(--s2);
  min-height: 44px; padding: 10px var(--s4);
  background: var(--surface); border: 1px solid var(--rule); border-radius: 8px;
  font: 500 14px/1.2 var(--sans); color: var(--navy); text-decoration: none;
  box-shadow: var(--lift-1); touch-action: manipulation;
  transition: transform 180ms var(--ease), box-shadow 180ms var(--ease), background-color 180ms var(--ease);
}
.contact-link:hover { background: #fff; transform: translateY(-2px); box-shadow: var(--lift-2); }
.contact-link:active { transform: translateY(0); box-shadow: var(--lift-1); }
.contact-link svg { width: 16px; height: 16px; flex: none; }

/* --- publications ------------------------------------------------------- */
.pub-controls {
  display: grid; gap: var(--s4);
  padding: var(--s5); margin-bottom: var(--s7);
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: 12px; box-shadow: var(--lift-1);
}
.field-label { font: 600 12px/1 var(--sans); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); display: block; margin-bottom: var(--s3); }
.search-field { position: relative; }
.search-field svg { position: absolute; left: 14px; top: 50%; margin-top: -9px; width: 18px; height: 18px; color: var(--ink-3); pointer-events: none; }
#pub-search {
  width: 100%; min-height: 48px; padding: 12px var(--s4) 12px 42px;
  font: 400 16px/1.5 var(--sans); color: var(--ink);
  background: var(--paper); border: 1px solid var(--rule); border-radius: 8px;
  transition: border-color 180ms var(--ease), box-shadow 180ms var(--ease);
}
#pub-search::placeholder { color: var(--ink-3); }
#pub-search:hover { border-color: rgba(0, 53, 148, 0.25); }
#pub-search:focus { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(0, 53, 148, 0.13); outline: none; }

.chips { display: flex; flex-wrap: wrap; gap: var(--s2); }
.chip {
  min-height: 44px; padding: 10px var(--s4);
  font: 500 14px/1.2 var(--sans); color: var(--ink-2);
  background: var(--paper); border: 1px solid var(--rule); border-radius: 999px;
  cursor: pointer; touch-action: manipulation;
  transition: background-color 180ms var(--ease), color 180ms var(--ease), border-color 180ms var(--ease), transform 140ms var(--ease);
}
.chip:hover { color: var(--ink); border-color: rgba(0, 53, 148, 0.3); }
.chip:active { transform: translateY(1px); }
.chip[aria-pressed='true'] {
  background: var(--navy); border-color: var(--navy); color: #fff; font-weight: 600;
  box-shadow: var(--lift-1);
}
.chip[aria-pressed='true']:hover { background: var(--navy-700); color: #fff; }

.pub-count {
  font: 500 14px/1.5 var(--sans); color: var(--ink-3);
  padding-top: var(--s3); border-top: 1px solid var(--rule-soft);
}

.pub-years { list-style: none; }
.year-group { margin-bottom: var(--s7); }
.year-head {
  display: flex; align-items: baseline; gap: var(--s4);
  position: sticky; top: var(--header-h, 68px); z-index: 10;
  padding: var(--s3) 0; margin-bottom: var(--s4);
  background: linear-gradient(to bottom, var(--paper) 72%, rgba(251, 250, 247, 0));
}
.year-head .y {
  font-family: var(--display); font-weight: 600; font-size: 1.5rem;
  letter-spacing: -0.02em; color: var(--navy);
}
.year-head .bar { flex: 1; height: 1px; background: var(--rule); }
.year-head .n { font: 500 13px/1 var(--sans); color: var(--ink-3); }

.pub-list { list-style: none; display: grid; gap: var(--s2); }
.pub {
  padding: var(--s4) var(--s5) var(--s4) var(--s5);
  background: var(--surface); border: 1px solid var(--rule-soft);
  border-left: 3px solid transparent; border-radius: 10px;
  transition: border-left-color 200ms var(--ease), box-shadow 200ms var(--ease), transform 200ms var(--ease);
}
.pub:hover { border-left-color: var(--gold); box-shadow: var(--lift-2); transform: translateX(2px); }
.pub-title { font-family: var(--display); font-size: 1.06rem; font-weight: 600; line-height: 1.4; letter-spacing: -0.012em; margin-bottom: var(--s2); }
.pub-title a { color: var(--ink); text-decoration: none; }
.pub-title a:hover { color: var(--navy); text-decoration: underline; text-decoration-color: var(--gold); text-decoration-thickness: 2px; }
.pub-authors { font-size: 0.925rem; color: var(--ink-2); line-height: 1.6; }
.pub-authors b { color: var(--ink); font-weight: 600; }
.pub-venue { font-size: 0.9rem; color: var(--ink-3); font-style: italic; line-height: 1.6; }
.pub mark { background: rgba(255, 184, 28, 0.42); color: inherit; border-radius: 2px; padding: 0 1px; }

.pub-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--s3); }
.tag {
  font: 500 11px/1 var(--sans); letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--navy); background: var(--tint);
  border: 1px solid var(--rule-soft); border-radius: 4px; padding: 5px 8px;
}

.state { padding: var(--s7) var(--s5); text-align: center; color: var(--ink-3); }
.state h3 { color: var(--ink); margin-bottom: var(--s2); }

/* --- footer ------------------------------------------------------------- */
.site-footer {
  background: var(--navy-900); color: #c9d3e8;
  padding: var(--s8) 0 var(--s6);
  font-size: 0.94rem; line-height: 1.75;
}
.site-footer a { color: #fff; text-decoration-color: rgba(255, 184, 28, 0.6); }
.site-footer a:hover { text-decoration-color: var(--gold); }
.footer-grid { display: grid; gap: var(--s6); grid-template-columns: 1fr; margin-bottom: var(--s6); }
@media (min-width: 760px) { .footer-grid { grid-template-columns: 1.3fr 1fr 1fr; gap: var(--s7); } }
.site-footer h2 { font-size: 1.3rem; color: #fff; margin-bottom: var(--s3); letter-spacing: -0.02em; }
.footer-h {
  font: 600 12px/1 var(--sans); letter-spacing: 0.13em; text-transform: uppercase;
  color: var(--gold); margin-bottom: var(--s4);
}
.site-footer ul { list-style: none; }
.site-footer li { margin-bottom: var(--s2); }
.site-footer address { font-style: normal; }
.colophon {
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  padding-top: var(--s5); font-size: 0.85rem; color: #94a4c4;
  display: flex; flex-wrap: wrap; gap: var(--s4); justify-content: space-between;
}

/* --- motion ------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .site-header, .pub-controls, .site-footer, .skip { display: none; }
  body { background: #fff; font-size: 11pt; }
  .pub { border: 0; padding: 0 0 8pt; break-inside: avoid; }
}
