/* ==========================================================================
   Kinetics Lab — design tokens
   Palette: dark "night lab" neutral + bright lab-teal + warm amber accent
   Type: serif display (Fraunces) / grotesk body (Inter) / mono utility (IBM Plex Mono)

   TO SWITCH BACK TO A LIGHT THEME: delete the active :root block below and
   uncomment the "LIGHT THEME" block further down (swap which one is active).
   Every other rule in this file references these variables, so that's the
   only place you need to change.
   ========================================================================== */

/* ---- ACTIVE THEME: dark ---- */
:root {
  --paper: #15171c;
  --paper-raised: #1d2027;
  --paper-rgb: 21, 23, 28;
  --ink: #ececee;
  --ink-soft: #9aa0ab;
  --rule: #2b2f38;
  --teal: #57b8a6;
  --teal-deep: #7fd9c7;
  --amber: #e3ac57;
  --card-shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 6px 20px rgba(0, 0, 0, 0.45);

  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Menlo, monospace;

  --measure: 42rem;
  --page-pad: clamp(1.25rem, 4vw, 3.5rem);
}

/* ---- LIGHT THEME (uncomment this block and delete/comment the block above
   to go back to a light background) ----
:root {
  --paper: #f6f6f3;
  --paper-raised: #ffffff;
  --paper-rgb: 246, 246, 243;
  --ink: #1c1c1a;
  --ink-soft: #4a4a45;
  --rule: #dcdcd5;
  --teal: #2c6e63;
  --teal-deep: #1c4a42;
  --amber: #c98a2c;
  --card-shadow: 0 1px 2px rgba(28, 28, 26, 0.04), 0 6px 20px rgba(28, 28, 26, 0.05);

  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Menlo, monospace;

  --measure: 42rem;
  --page-pad: clamp(1.25rem, 4vw, 3.5rem);
}
*/

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--teal); color: var(--paper); }

a { color: inherit; text-decoration-color: var(--rule); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--teal); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); font-weight: 500; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.2rem; }

p { margin: 0 0 1.1em; }

code, .mono { font-family: var(--font-mono); }

.wrap {
  max-width: 78rem;
  margin: 0 auto;
  padding: 0 var(--page-pad);
}

.prose {
  max-width: var(--measure);
}
.prose h2, .prose h3 { margin-top: 1.6em; }
.prose ul, .prose ol { padding-left: 1.2em; }

/* ---------- header / nav ---------- */

.site-header {
  border-bottom: 1px solid var(--rule);
  position: sticky;
  top: 0;
  background: rgba(var(--paper-rgb), 0.92);
  backdrop-filter: blur(6px);
  z-index: 40;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  padding-bottom: 1rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: -0.01em;
}
.brand .dot { color: var(--teal); }

.nav {
  display: flex;
  gap: 1.4rem;
  flex-wrap: wrap;
  font-size: 0.95rem;
}
.nav a {
  text-decoration: none;
  color: var(--ink-soft);
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
}
.nav a:hover, .nav a.active {
  color: var(--ink);
  border-bottom-color: var(--teal);
}

/* ---------- hero ---------- */

.hero {
  padding: clamp(3rem, 8vw, 6rem) 0 clamp(2rem, 6vw, 3.5rem);
  border-bottom: 1px solid var(--rule);
}
.hero .eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-transform: lowercase;
  letter-spacing: 0.04em;
  color: var(--teal-deep);
  margin-bottom: 0.9rem;
}
.hero h1 { max-width: 22ch; }
.hero .tagline {
  font-size: 1.15rem;
  color: var(--ink-soft);
  max-width: 40rem;
  margin-top: 0.6rem;
}
.hero .affiliation {
  font-size: 0.92rem;
  color: var(--ink-soft);
  margin-top: 1.4rem;
}

/* ---------- section ---------- */

.section {
  padding: clamp(2.5rem, 6vw, 4rem) 0;
  border-bottom: 1px solid var(--rule);
}
.section:last-of-type { border-bottom: none; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.6rem;
  flex-wrap: wrap;
}
.section-head h2 { margin: 0; }
.section-head .see-all {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--teal-deep);
  white-space: nowrap;
  text-decoration: none;
}
.section-head .see-all:hover { text-decoration: underline; }

/* ---------- research prose blocks ---------- */

.research-block { margin-bottom: 2.2rem; max-width: var(--measure); }
.research-block h3 { color: var(--teal-deep); }

/* ---------- people ---------- */

.people-group { margin-bottom: 2.8rem; }
.people-group h3 {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  font-weight: 500;
  margin-bottom: 1.2rem;
}
.people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 1.6rem 1.4rem;
}
.person-card { text-decoration: none; color: var(--ink); }
.person-photo {
  aspect-ratio: 1 / 1;
  width: 100%;
  border-radius: 6px;
  overflow: hidden;
  background: var(--rule);
  margin-bottom: 0.7rem;
}
.person-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.person-name { font-weight: 600; font-size: 0.98rem; }
.person-role { font-size: 0.85rem; color: var(--ink-soft); }

.alumni-list { display: flex; flex-wrap: wrap; gap: 0.5rem 1.6rem; font-size: 0.95rem; color: var(--ink-soft); }

.person-detail-header { display: flex; gap: 1.8rem; flex-wrap: wrap; align-items: flex-start; margin-bottom: 2rem; }
.person-detail-photo { width: 160px; height: 160px; border-radius: 8px; overflow: hidden; background: var(--rule); flex-shrink: 0; }
.person-detail-photo img { width: 100%; height: 100%; object-fit: cover; }
.person-links { display: flex; gap: 0.9rem; margin-top: 0.6rem; font-family: var(--font-mono); font-size: 0.85rem; }

/* ---------- publications ---------- */

.pub-list { list-style: none; margin: 0; padding: 0; }
.pub-item {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 1.2rem;
  padding: 1.1rem 0;
  border-top: 1px solid var(--rule);
}
.pub-item:first-child { border-top: none; }
.pub-year { font-family: var(--font-mono); color: var(--teal-deep); font-size: 0.95rem; padding-top: 0.15rem; }
.pub-title { font-weight: 600; margin: 0 0 0.25rem; font-size: 1.02rem; }
.pub-authors { color: var(--ink-soft); font-size: 0.94rem; margin: 0 0 0.2rem; }
.pub-venue { font-size: 0.88rem; color: var(--ink-soft); font-style: italic; }
.pub-key { font-family: var(--font-mono); font-size: 0.75rem; color: var(--rule); margin-left: 0.5em; }
.pub-links { margin-top: 0.4rem; display: flex; gap: 0.9rem; font-family: var(--font-mono); font-size: 0.8rem; }
.pub-links a { text-decoration: none; color: var(--teal-deep); border: 1px solid var(--rule); padding: 0.15rem 0.55rem; border-radius: 4px; }
.pub-links a:hover { border-color: var(--teal); background: var(--paper-raised); }
.pub-filter { font-family: var(--font-mono); font-size: 0.85rem; margin-bottom: 1.5rem; display: flex; gap: 0.8rem; flex-wrap: wrap; }
.pub-filter button {
  font-family: var(--font-mono); font-size: 0.8rem; background: none; border: 1px solid var(--rule);
  padding: 0.25rem 0.7rem; border-radius: 999px; cursor: pointer; color: var(--ink-soft);
}
.pub-filter button.active { background: var(--teal); border-color: var(--teal); color: var(--paper); }

/* ---------- news ---------- */

.news-list { list-style: none; margin: 0; padding: 0; }
.news-item { display: flex; gap: 1.2rem; padding: 0.9rem 0; border-top: 1px solid var(--rule); }
.news-item:first-child { border-top: none; }
.news-date { font-family: var(--font-mono); font-size: 0.82rem; color: var(--ink-soft); width: 6rem; flex-shrink: 0; padding-top: 0.1rem; }
.news-title { margin: 0; font-size: 1rem; font-weight: 600; }
.news-title a { text-decoration: none; }
.news-title a:hover { text-decoration: underline; }

/* ---------- cards / grid ---------- */

.card {
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 1.4rem;
  box-shadow: var(--card-shadow);
}

/* ---------- footer ---------- */

.site-footer {
  padding: 2.5rem 0 3.5rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
}
.site-footer .foot-top {
  display: flex; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap;
  padding-bottom: 1.4rem; margin-bottom: 1.2rem; border-bottom: 1px solid var(--rule);
}
.site-footer .foot-links { display: flex; gap: 1.2rem; flex-wrap: wrap; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.footer-note { font-style: italic; }

/* ---------- pinned quote widget ----------
   This card is a deliberate fixed warm-paper "index card" that pops
   against either theme, so it uses its own fixed colors instead of the
   theme variables below. */

#quote-pin {
  position: fixed;
  right: 1.4rem;
  bottom: 1.4rem;
  max-width: 280px;
  background: #fffdf6;
  border: 1px solid #e4ddc8;
  border-radius: 2px;
  padding: 0.95rem 1.05rem 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.45;
  color: #2a2620;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
  transform: rotate(-1.4deg);
  transition: transform 0.15s ease, opacity 0.2s ease;
  z-index: 50;
}
#quote-pin:hover { transform: rotate(0deg); }
#quote-pin::before {
  content: "";
  position: absolute;
  top: -7px;
  left: 22px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 1px 2px rgba(0,0,0,0.35);
}
#quote-pin .qtext { display: block; margin-bottom: 0.5rem; }
#quote-pin .qtext::before { content: "\201C"; }
#quote-pin .qtext::after { content: "\201D"; }
#quote-pin .qauthor { display: block; color: #6b6656; margin-bottom: 0.55rem; }
#quote-pin .qauthor::before { content: "\2014 "; }
#quote-pin .qactions { display: flex; justify-content: space-between; align-items: center; }
#quote-pin button {
  font-family: var(--font-mono); font-size: 0.72rem; background: none; border: none;
  color: #2c6e63; cursor: pointer; padding: 0; text-decoration: underline;
}
#quote-pin .qclose {
  color: #6b6656; text-decoration: none; font-size: 0.95rem; line-height: 1; cursor: pointer;
  background: none; border: none;
}
#quote-pin.hidden { opacity: 0; pointer-events: none; transform: translateY(10px); }

@media (max-width: 640px) {
  #quote-pin { left: 1rem; right: 1rem; max-width: none; bottom: 1rem; }
  .pub-item { grid-template-columns: 1fr; }
  .pub-year { padding-top: 0; }
  .person-detail-header { flex-direction: column; }
}

/* ---------- misc ---------- */

.tag-list { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.5rem; }
.tag {
  font-family: var(--font-mono); font-size: 0.72rem; color: var(--ink-soft);
  border: 1px solid var(--rule); border-radius: 999px; padding: 0.1rem 0.6rem;
}
.btn {
  display: inline-block; font-family: var(--font-mono); font-size: 0.85rem;
  border: 1px solid var(--ink); color: var(--ink); text-decoration: none;
  padding: 0.5rem 1.1rem; border-radius: 4px;
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn-primary { background: var(--teal); border-color: var(--teal); color: var(--paper); }
.btn-primary:hover { background: var(--teal-deep); border-color: var(--teal-deep); }

/* ---------- handbook ---------- */

.hb-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 3rem;
  padding: clamp(2rem, 5vw, 3.5rem) 0;
  align-items: start;
}
.hb-sidebar {
  position: sticky;
  top: 5.5rem;
  font-size: 0.9rem;
}
.hb-home-link {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  text-decoration: none;
  color: var(--ink-soft);
  margin-bottom: 1.2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--rule);
}
.hb-home-link.active, .hb-home-link:hover { color: var(--teal-deep); }
.hb-group { margin-bottom: 1.3rem; }
.hb-group-title {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  margin-bottom: 0.5rem;
}
.hb-group a {
  display: block;
  text-decoration: none;
  color: var(--ink);
  padding: 0.25rem 0;
  font-size: 0.9rem;
  border-left: 2px solid transparent;
  padding-left: 0.6rem;
  margin-left: -0.6rem;
}
.hb-group a:hover { color: var(--teal-deep); }
.hb-group a.active { color: var(--teal-deep); border-left-color: var(--teal); font-weight: 600; }

.hb-search { position: relative; margin-bottom: 1.2rem; }
.hb-search input {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  color: var(--ink);
  border-radius: 6px;
  padding: 0.5rem 0.7rem;
}
.hb-search input::placeholder { color: var(--ink-soft); }
.hb-search input:focus { outline: none; border-color: var(--teal); }
#hb-search-results {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: 6px;
  box-shadow: var(--card-shadow);
  z-index: 60;
  max-height: 280px;
  overflow-y: auto;
}
#hb-search-results.open { display: block; }
#hb-search-results a {
  display: block;
  padding: 0.55rem 0.75rem;
  text-decoration: none;
  color: var(--ink);
  font-size: 0.85rem;
  border-bottom: 1px solid var(--rule);
}
#hb-search-results a:last-child { border-bottom: none; }
#hb-search-results a:hover { background: var(--paper); }
.hb-search-empty { padding: 0.6rem 0.75rem; font-size: 0.85rem; color: var(--ink-soft); }

.hb-content { min-width: 0; }
.hb-crumb { color: var(--ink-soft); margin-bottom: 0.4rem; }
.hb-pagenav {
  display: flex;
  margin-top: 2.5rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}
.hb-pagenav a { text-decoration: none; color: var(--teal-deep); }
.hb-pagenav a:hover { text-decoration: underline; }
.hb-content table { border-collapse: collapse; width: 100%; margin: 1.2rem 0; font-size: 0.92rem; }
.hb-content th, .hb-content td { border: 1px solid var(--rule); padding: 0.5rem 0.7rem; text-align: left; }
.hb-content th { background: var(--paper-raised); }

@media (max-width: 800px) {
  .hb-layout { grid-template-columns: 1fr; }
  .hb-sidebar { position: static; }
}
