/* ============================================================
   IBC Labs — Component Styles
   ============================================================ */

/* ---------- Navbar ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.nav__brand {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
}
.nav__mark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 21px;
  letter-spacing: 0.02em;
  color: var(--accent);
}
.nav__brandname {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 21px;
  color: var(--text);
}
.nav__links {
  display: flex;
  align-items: center;
  gap: var(--s3);
}
.nav__link {
  position: relative;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text-2);
  padding: 4px 0;
  transition: color .16s ease;
}
.nav__link:hover { color: var(--text); }
.nav__link.is-active { color: var(--accent); }
.nav__link.is-active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: var(--accent);
}
.nav__burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 6px;
}
.nav__burger span {
  display: block;
  width: 22px; height: 1.5px;
  background: var(--text);
}
.nav__overlay {
  position: fixed;
  inset: 68px 0 0 0;
  background: rgba(247,246,243,.98);
  backdrop-filter: blur(2px);
  z-index: 49;
  animation: pageIn .25s ease both;
}
.nav__overlay-links {
  display: flex;
  flex-direction: column;
  padding: var(--s4);
  gap: var(--s2);
}
.nav__overlay-link {
  font-family: var(--font-display);
  font-size: 26px;
  color: var(--text);
}
.nav__overlay-link.is-active { color: var(--accent); }

/* ---------- Page header ---------- */
.pagehead { padding: var(--s5) 0 0; }
.pagehead__title { margin-bottom: var(--s1); }
.pagehead__lead { max-width: 640px; margin-bottom: 0; }

/* ---------- Back link ---------- */
.backlink {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  padding: var(--s4) 0 0;
  transition: color .16s ease;
}
.backlink:hover { color: var(--accent); }

/* ---------- Pills / tags ---------- */
.pill {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-2);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 2px 9px;
  border-radius: 100px;
  margin-left: auto;
}

/* ---------- Hero (home) ---------- */
.hero { padding: var(--s7) 0 var(--s6); }
.hero__eyebrow { margin-bottom: var(--s3); }
.hero__title {
  max-width: 16ch;
  margin-bottom: var(--s4);
}
.hero__title .accent-line { display: block; }
.hero__mission {
  font-size: 21px;
  line-height: 1.55;
  color: var(--text-2);
  max-width: 52ch;
  margin-bottom: var(--s4);
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
}
.hero__rule { max-width: 220px; margin: var(--s5) 0 0; }

/* ---------- Section heading ---------- */
.sectionhead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s3);
  margin-bottom: var(--s4);
}
.sectionhead__title { }
.sectionhead__link { font-size: 14px; }

/* ---------- Grid ---------- */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s3);
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--s3);
}

/* ---------- Area card ---------- */
.areacard {
  display: flex;
  flex-direction: column;
  min-height: 230px;
}
.areacard__code {
  color: var(--accent);
  letter-spacing: 0.08em;
  margin-bottom: var(--s2);
}
.areacard__name { margin-bottom: var(--s2); }
.areacard__blurb { font-size: 15.5px; flex: 1; margin-bottom: var(--s3); }
.areacard__cta { margin-top: auto; }

/* ---------- Featured papers ---------- */
.featured__row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s4);
  padding: var(--s3) 0;
}
.featured__row .featured__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  margin-bottom: 8px;
}
.featured__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 14px;
  color: var(--text-2);
}
.featured__actions { display: flex; gap: var(--s3); white-space: nowrap; padding-top: 4px; }

/* ---------- Paper row (index) ---------- */
.paperrow { padding: var(--s4) 0; }
.paperrow__title { margin-bottom: 10px; transition: color .16s ease; }
.paperrow__titlelink:hover .paperrow__title { color: var(--accent); }
.paperrow__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 14px;
  color: var(--text-2);
  margin-bottom: var(--s2);
}
.paperrow__dot { color: var(--border); }
.paperrow__abstract {
  font-size: 16.5px;
  line-height: 1.6;
  max-width: 70ch;
  margin-bottom: var(--s3);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.paperrow__actions { display: flex; gap: var(--s4); }
.tlink--muted { color: var(--text-2); }
.tlink--muted:hover { color: var(--accent); }

/* ---------- Filter bar ---------- */
.filterbar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: var(--s4) 0 0;
}
.filter {
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-2);
  background: transparent;
  border: 1px solid var(--border);
  padding: 7px 15px;
  border-radius: 100px;
  cursor: pointer;
  transition: all .16s ease;
}
.filter:hover { border-color: var(--accent); color: var(--accent); }
.filter.is-active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ---------- Search ---------- */
.search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 11px 15px;
  max-width: 420px;
  margin: var(--s4) 0 0;
}
.search:focus-within { border-color: var(--accent); }
.search input {
  border: 0;
  outline: 0;
  background: transparent;
  font-family: var(--font-body);
  font-size: 15px;
  width: 100%;
  color: var(--text);
}
.search__icon { color: var(--text-2); font-size: 15px; }

/* ---------- Paper detail layout ---------- */
.paperlayout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: var(--s5);
  padding: var(--s4) 0 0;
  align-items: start;
}
.paperdetail__status { margin-bottom: var(--s3); }
.paperdetail__title { margin-bottom: var(--s2); max-width: 20ch; }
.paperdetail__byline { font-size: 15px; color: var(--text-2); margin-bottom: var(--s4); }
.paperdetail__abstract {
  font-size: 19px;
  line-height: 1.7;
  font-style: italic;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 400;
  margin-bottom: var(--s5);
}
.paperbody h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  margin: var(--s5) 0 var(--s3);
}
.paperbody p { font-size: 17.5px; line-height: 1.75; }
.related { margin-top: var(--s5); padding-top: var(--s4); border-top: 1px solid var(--border); }
.related__title { margin-bottom: var(--s2); }
.related__links { display: flex; flex-direction: column; gap: 10px; }

/* ---------- Sidebar ---------- */
.sidebar {
  position: sticky;
  top: 92px;
  display: flex;
  flex-direction: column;
  gap: var(--s4);
}
.sidebar__block {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: var(--s3);
}
.sidebar__label { margin-bottom: 8px; }
.sidebar__value { font-size: 15px; }
.bibtex {
  background: var(--accent);
  color: #dfe8f5;
  padding: var(--s2);
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.6;
  white-space: pre;
  overflow-x: auto;
  margin: 10px 0;
}
.copybtn {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0;
}
.revlist { display: flex; flex-direction: column; gap: 10px; }
.revlist__item { display: flex; flex-direction: column; gap: 1px; }
.revlist__v { font-family: var(--font-mono); font-size: 13px; color: var(--accent); }
.revlist__note { font-size: 13px; color: var(--text-2); }

/* ---------- Concept entry ---------- */
.concept { padding: var(--s3) 0; }
.concept__term {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 18px;
  margin-bottom: 6px;
}
.concept__def { font-size: 16px; line-height: 1.6; color: var(--text); margin-bottom: 8px; max-width: 72ch; }
.concept__see { font-size: 14px; color: var(--text-2); }
.concept__see a { color: var(--accent); }
.concept__see a:hover { text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Prose sections (problem) ---------- */
.prosesec { padding: var(--s4) 0; }
.prosesec__h {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 26px;
  margin-bottom: var(--s2);
  max-width: 18ch;
}
.prosesec__body { max-width: 66ch; }
.prosesec__body p { font-size: 18px; line-height: 1.75; color: var(--text-2); }

/* ---------- Audience chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: var(--s3) 0; }
.chip {
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-tint);
  padding: 6px 14px;
  border-radius: 100px;
}

/* ---------- Note card ---------- */
.notecard { display: flex; flex-direction: column; }
.notecard__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: var(--text-2);
  margin-bottom: var(--s2);
}
.notecard__title { margin-bottom: 10px; }
.notecard__excerpt { font-size: 15.5px; flex: 1; margin-bottom: var(--s3); }

/* ---------- Contact ---------- */
.contactlayout {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: var(--s5);
  padding: var(--s4) 0 0;
  align-items: start;
}
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--s3); }
.field label { font-size: 13px; font-weight: 500; color: var(--text-2); letter-spacing: 0.02em; }
.field input, .field textarea {
  font-family: var(--font-body);
  font-size: 15.5px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 11px 13px;
  outline: 0;
  transition: border-color .16s ease;
  resize: vertical;
}
.field input:focus, .field textarea:focus { border-color: var(--accent); }
.field--error input, .field--error textarea { border-color: #b04444; }
.field__err { font-size: 12.5px; color: #b04444; }
.contact__sidecol { display: flex; flex-direction: column; gap: var(--s4); }
.contact__email {
  font-family: var(--font-mono);
  font-size: 16px;
  color: var(--accent);
}
.contact__people { display: flex; flex-direction: column; gap: 10px; }
.formsuccess {
  background: var(--status-pub-bg);
  color: var(--status-pub-fg);
  border-radius: 3px;
  padding: var(--s3);
  font-size: 15px;
}

/* ---------- About ---------- */
.teamgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s3); }
.teamcard { background: var(--surface); border: 1px solid var(--border); padding: var(--s3); }
.teamcard__name { font-family: var(--font-display); font-weight: 600; font-size: 20px; margin-bottom: 4px; }
.teamcard__role { font-size: 13px; color: var(--accent); font-weight: 500; margin-bottom: 10px; letter-spacing: 0.02em; }
.teamcard__focus { font-size: 14px; color: var(--text-2); }

/* ---------- Methodology ---------- */
.methsteps { counter-reset: step; margin-top: var(--s4); }
.methstep {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: var(--s3);
  padding: var(--s3) 0;
}
.methstep__num {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 28px;
  color: var(--accent);
  line-height: 1;
}
.methstep__h { font-weight: 600; font-size: 18px; margin-bottom: 6px; }
.methstep__p { font-size: 16px; color: var(--text-2); max-width: 60ch; margin: 0; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
  .nav__links { display: none; }
  .nav__burger { display: flex; }
  .grid-3, .teamgrid { grid-template-columns: 1fr 1fr; }
  .paperlayout { grid-template-columns: 1fr; gap: var(--s4); }
  .sidebar { position: static; }
  .contactlayout { grid-template-columns: 1fr; gap: var(--s4); }
  .featured__row { flex-direction: column; gap: var(--s2); }
  .featured__actions { padding-top: var(--s1); }
}
@media (max-width: 600px) {
  .container { padding: 0 var(--s3); }
  .grid-3, .grid-2, .teamgrid { grid-template-columns: 1fr; }
  .hero { padding: var(--s5) 0 var(--s4); }
  .section { padding: var(--s5) 0; }
  .sectionhead { flex-direction: column; gap: var(--s1); }
}
