/* ============================================================
   LEVARI LAB — stylesheet (single file, all pages)
   ============================================================ */

:root {
  /* palette (vibrant — inspired by the lab flyer) */
  --bg:            #fce6ce;   /* light warm orange page (less pink) */
  --surface:       #fbf4d8;   /* pale cream card (flyer card color) */
  --surface-plain: #fffdf5;   /* near-white for modals/photos */
  --text:          #3a2a17;   /* warm dark brown */
  --muted:         #856f52;   /* warm muted brown */
  --accent:        #9a571c;   /* caramel/amber brown (headings, links) */
  --accent-dark:   #7c4514;
  --brown-strong:  #3d2a15;   /* chunky border brown (flyer outlines) */
  --sage:          #7f9a80;   /* green from logo */
  --apple:         #b23a30;   /* apple red */
  --border:        #ecd9ba;   /* warm border */
  --border-strong: #d8bd90;

  /* spacing scale */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;

  --nav-h: 68px;
  --max:   1080px;
  --radius: 14px;
  --radius-sm: 9px;
  --radius-lg: 22px;

  --shadow:       0 1px 2px rgba(61,42,21,.05), 0 6px 20px rgba(61,42,21,.08);
  --shadow-hover: 0 2px 6px rgba(61,42,21,.07), 0 16px 34px rgba(61,42,21,.14);

  --font: 'Helvetica Neue', -apple-system, BlinkMacSystemFont, 'Segoe UI',
          system-ui, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); }

/* Shared page-width container */
.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--s-5);
}

/* ============================================================
   NAV  — fixed height, single row, never reflows the brand
   ============================================================ */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(252,230,206,.9);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
}

.site-nav-inner {
  max-width: var(--max);
  margin-inline: auto;
  min-height: var(--nav-h);
  padding: var(--s-3) var(--s-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-5);
  flex-wrap: wrap;
}

.site-nav-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  text-decoration: none;
  flex-shrink: 0;
}

/* the illustration mark (portrait) used as an emblem */
.site-nav-brand img {
  height: 44px;
  width: auto;
}

.site-nav-brand span {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--accent);
  white-space: nowrap;
}

.site-nav-links {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav-links a {
  display: inline-block;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
  padding: var(--s-2) var(--s-3);
  border-radius: 999px;
  white-space: nowrap;
  transition: color .15s ease, background .15s ease;
}

.site-nav-links a:hover { color: var(--accent); background: rgba(154,87,28,.10); }

/* active state uses color + pill background only — no size change,
   so switching pages never shifts the layout */
.site-nav-links a.active {
  color: var(--accent);
  background: rgba(154,87,28,.18);
  font-weight: 600;
}

@media (max-width: 640px) {
  .site-nav-inner {
    justify-content: center;
    gap: var(--s-3);
    padding-top: var(--s-3);
    padding-bottom: var(--s-3);
  }
  .site-nav-links { flex-wrap: wrap; justify-content: center; gap: var(--s-1); }
  .site-nav-links a { font-size: 0.9rem; padding: 6px 10px; }
}

/* ============================================================
   MAIN + FOOTER
   ============================================================ */
.site-main {
  flex: 1;
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding: var(--s-8) var(--s-5) var(--s-9);
}

.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
  padding: var(--s-6) var(--s-5);
  text-align: center;
}
.site-footer p { margin: 0; }
.site-footer a { color: var(--accent); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* ============================================================
   SECTION TITLE (shared)
   ============================================================ */
.section-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  font-weight: 700;
  margin: 0 0 var(--s-5);
  padding-bottom: var(--s-3);
  border-bottom: 2px solid var(--border-strong);
}

/* ============================================================
   HOMEPAGE — hero
   ============================================================ */
.hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  min-height: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(28px, 5vw, 56px);
  margin-bottom: var(--s-8);
  box-shadow: var(--shadow);
}

/* full mascot, large, standing at the bottom-right of the card */
.hero-art {
  position: absolute;
  right: clamp(16px, 4%, 52px);
  bottom: 0;
  height: min(86%, 356px);
  width: auto;
  z-index: 1;
  pointer-events: none;
}

.hero-content { position: relative; z-index: 2; max-width: 56%; }

.hero-title {
  font-size: clamp(2.4rem, 5.5vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin: 0 0 var(--s-3);
  color: var(--accent);
}

.hero-affil {
  color: var(--text);
  font-size: 0.98rem;
  font-weight: 600;
  margin: 0 0 var(--s-5);
}
.hero-affil .affil-inst { white-space: nowrap; }

.hero-tagline {
  color: var(--text);
  font-size: 1.12rem;
  line-height: 1.65;
  max-width: 30em;
  margin: 0 0 var(--s-6);
}

.hero-cta { display: flex; gap: var(--s-3); flex-wrap: wrap; }

@media (max-width: 760px) {
  .hero { text-align: center; padding: var(--s-7) var(--s-5); min-height: 0; }
  .hero-content { max-width: 100%; }
  /* on small screens the mascot becomes a soft watermark behind the text */
  .hero-art {
    height: auto;
    width: 300px;
    max-width: 78%;
    left: 50%;
    right: auto;
    top: 50%;
    bottom: auto;
    transform: translate(-50%, -50%);
    opacity: 0.13;
    z-index: 0;
  }
  .hero-tagline { margin-left: auto; margin-right: auto; }
  .hero-cta { justify-content: center; }
}

/* ---- flyer-style chunky card outlines (experiment) ---- */
.research-card,
.person-card,
.pi-card,
.research-row,
.involve-section {
  border-width: 2px;
  border-color: var(--brown-strong);
}

/* buttons */
.btn-primary, .btn-secondary {
  display: inline-block;
  text-decoration: none;
  padding: 11px 24px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: background .15s ease, transform .15s ease, box-shadow .15s ease;
}
.btn-primary {
  background: var(--accent);
  color: #fff !important;
  box-shadow: var(--shadow);
}
.btn-primary:hover { background: var(--accent-dark); transform: translateY(-2px); }
.btn-secondary {
  background: transparent;
  color: var(--accent) !important;
  border: 1.5px solid var(--border-strong);
}
.btn-secondary:hover { border-color: var(--accent); background: #f3ede4; transform: translateY(-2px); }

/* ============================================================
   HOMEPAGE — sections
   ============================================================ */
.section { margin-bottom: var(--s-8); }

.research-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--s-5);
}

.research-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--s-6) var(--s-5);
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  position: relative;
  overflow: hidden;
}
.research-card::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 4px; background: var(--sage);
  opacity: 0; transition: opacity .2s ease;
}
.research-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: var(--border-strong);
}
.research-card:hover::before { opacity: 1; }
.research-card h3 { margin: 0 0 var(--s-2); font-size: 1.08rem; color: var(--accent); line-height: 1.3; }
.research-card p { margin: 0; font-size: 0.94rem; color: var(--muted); line-height: 1.6; }

/* news list */
.news-list { display: flex; flex-direction: column; }
.news-item {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: var(--s-5);
  padding: var(--s-4) 0;
  border-bottom: 1px solid var(--border);
  align-items: baseline;
}
.news-item:last-child { border-bottom: none; }
.news-date { font-size: 0.86rem; color: var(--accent); font-weight: 600; white-space: nowrap; }
.news-item p { margin: 0; color: var(--text); font-size: 0.97rem; }

@media (max-width: 520px) {
  .news-item { grid-template-columns: 1fr; gap: var(--s-1); }
}

/* ============================================================
   PLACEHOLDER PAGES (research / publications / contact)
   ============================================================ */
.page h1 {
  font-size: clamp(2rem, 4vw, 2.6rem);
  letter-spacing: -0.02em;
  margin: 0 0 var(--s-3);
  color: var(--text);
}
.page-intro { color: var(--muted); font-size: 1.08rem; max-width: 40em; margin: 0 0 var(--s-7); }
.coming-soon {
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: var(--s-7) var(--s-6);
  text-align: center;
  color: var(--muted);
  font-size: 0.97rem;
  max-width: 40em;
}
.coming-soon strong { display: block; font-size: 1.1rem; color: var(--text); margin-bottom: var(--s-2); }

/* ============================================================
   PEOPLE PAGE
   ============================================================ */
.people-intro { margin: 0 0 var(--s-7); max-width: 44em; }
.people-intro h1 {
  font-size: clamp(2rem, 4vw, 2.6rem);
  letter-spacing: -0.02em;
  margin: 0 0 var(--s-3);
  color: var(--text);
}
.people-intro p { color: var(--muted); font-size: 1.08rem; margin: 0; }

.people-section { margin: 0 0 var(--s-8); }

.people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: var(--s-6);
}

.person-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}
.person-card:hover, .person-card:focus-visible {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: var(--border-strong);
  outline: none;
}
.person-photo {
  aspect-ratio: 1 / 1;
  width: 100%;
  object-fit: cover;
  background: #efe9dc;
}
.person-meta { padding: var(--s-4) var(--s-4) var(--s-5); }
.person-name { font-size: 1.02rem; font-weight: 600; margin: 0 0 var(--s-1); color: var(--text); line-height: 1.3; }
.person-role { font-size: 0.88rem; color: var(--muted); margin: 0; line-height: 1.4; }

/* image-based name (privacy card) */
.person-name-img {
  display: block;
  height: 1.15rem;
  width: auto;
  max-width: 100%;
  margin: 0 0 var(--s-1);
  object-fit: contain;
  object-position: left center;
}

/* PI featured card */
.pi-card {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: var(--s-6);
  align-items: start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--s-6);
  box-shadow: var(--shadow);
}
.pi-card > img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: #efe9dc;
}
.pi-card h3 { margin: 0 0 var(--s-1); font-size: 1.5rem; color: var(--text); letter-spacing: -0.01em; }
.pi-role { color: var(--accent); font-weight: 600; margin: 0 0 var(--s-4); font-size: 0.96rem; }
.pi-card p { color: var(--text); margin: 0 0 var(--s-3); }
.pi-links { margin-top: var(--s-4); display: flex; flex-wrap: wrap; gap: var(--s-4); }
.pi-links a {
  color: var(--accent); text-decoration: none; font-weight: 500; font-size: 0.95rem;
  border-bottom: 1.5px solid transparent; transition: border-color .15s ease;
}
.pi-links a:hover { border-bottom-color: var(--accent); }

@media (max-width: 640px) {
  .pi-card { grid-template-columns: 1fr; padding: var(--s-5); gap: var(--s-5); }
  .pi-card > img { max-width: 200px; }
}

/* ============================================================
   PEOPLE — CSS-only modal (:target)
   ============================================================ */
.person-modal {
  position: fixed; inset: 0;
  background: rgba(43,36,30,.55);
  display: none;
  align-items: center; justify-content: center;
  z-index: 9999; padding: var(--s-5);
}
.person-modal:target { display: flex; animation: pmFade .18s ease-out; }
@keyframes pmFade { from { opacity: 0; } to { opacity: 1; } }

.modal-backdrop { position: absolute; inset: 0; cursor: zoom-out; text-decoration: none; }
.modal-inner {
  position: relative;
  background: #fff;
  border-radius: var(--radius);
  max-width: 620px; width: 100%; max-height: 88vh;
  overflow-y: auto;
  padding: var(--s-6);
  box-shadow: 0 24px 64px rgba(43,36,30,.32);
}
.modal-close {
  position: absolute; top: var(--s-3); right: var(--s-4);
  background: none; border: none;
  font-size: 1.7rem; line-height: 1;
  color: var(--muted) !important; text-decoration: none;
  cursor: pointer; padding: var(--s-1) var(--s-2);
}
.modal-close:hover { color: var(--text) !important; }

.modal-header { display: flex; gap: var(--s-5); align-items: flex-start; margin-bottom: var(--s-5); padding-right: var(--s-6); }
.modal-header > img { width: 112px; height: 112px; object-fit: cover; border-radius: var(--radius-sm); flex-shrink: 0; background: #efe9dc; }
.modal-header h3 { margin: 0 0 var(--s-1); font-size: 1.35rem; color: var(--text); }
.modal-role { color: var(--accent); font-weight: 600; font-size: 0.95rem; margin: 0; }
.modal-header .person-name-img { height: 1.52rem; margin-bottom: var(--s-2); }

.modal-bio { color: var(--text); }
.modal-bio p { margin: 0 0 var(--s-3); }
.modal-links { margin-top: var(--s-4); display: flex; flex-wrap: wrap; gap: var(--s-4); }
.modal-links a { color: var(--accent); text-decoration: none; font-weight: 500; font-size: 0.95rem; border-bottom: 1.5px solid transparent; }
.modal-links a:hover { border-bottom-color: var(--accent); }

@media (max-width: 480px) {
  .modal-inner { padding: var(--s-5) var(--s-4); }
  .modal-header { flex-direction: column; }
  .modal-header > img { width: 96px; height: 96px; }
}

/* ============================================================
   RESEARCH PAGE — alternating rows
   ============================================================ */
.research-list { display: flex; flex-direction: column; gap: var(--s-6); }

.research-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-7);
  align-items: center;
  padding: var(--s-7);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  scroll-margin-top: 90px;          /* clears the sticky nav on deep-links */
}

/* alternating bands: even rows get a soft sage tint + figure on the right */
.research-row:nth-child(even) {
  background: #eef1ea;
  border-color: #dfe6db;
}
.research-row:nth-child(even) .research-figure { order: 2; }

.research-figure { margin: 0; }
.research-figure img {
  width: 100%;
  height: auto;                 /* show the whole figure — no cropping */
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: #efe9dc;
}
.research-credit {
  margin-top: var(--s-2);
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
}
.research-credit a { color: var(--accent); text-decoration: none; border-bottom: 1px solid transparent; }
.research-credit a:hover { border-bottom-color: var(--accent); }

.research-row-title {
  font-size: 1.6rem;
  letter-spacing: -0.01em;
  margin: 0 0 var(--s-3);
  color: var(--text);
}
.research-row-body { color: var(--text); font-size: 1.05rem; line-height: 1.7; margin: 0; }

.research-paper {
  margin-top: var(--s-5);
  padding-top: var(--s-4);
  border-top: 1px solid var(--border);
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.6;
}
.research-paper .label {
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: var(--s-2);
}
.research-paper cite { font-style: normal; }
.research-paper .paper-links { margin-top: var(--s-2); display: flex; flex-wrap: wrap; gap: var(--s-3); }
.research-paper a {
  color: var(--accent); text-decoration: none; font-weight: 500;
  border-bottom: 1.5px solid transparent; transition: border-color .15s ease;
}
.research-paper a:hover { border-bottom-color: var(--accent); }

@media (max-width: 760px) {
  .research-row { grid-template-columns: 1fr; gap: var(--s-5); padding: var(--s-5); }
  .research-row:nth-child(even) .research-figure,
  .research-figure { order: -1; }   /* figure always on top when stacked */
}

/* ============================================================
   PUBLICATIONS PAGE — year-grouped list, shared paper styling
   ============================================================ */
.pub-year {
  margin: 0 0 var(--s-7);
}
.pub-year-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  font-weight: 700;
  margin: 0 0 var(--s-4);
  padding-bottom: var(--s-3);
  border-bottom: 2px solid var(--border-strong);
}

.pub-item {
  padding: var(--s-4) 0;
  border-bottom: 1px solid var(--border);
}
.pub-item:last-child { border-bottom: none; }

.pub-item cite {
  font-style: normal;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.6;
  display: block;
}
.pub-item cite .pub-title { font-weight: 600; }
.pub-item cite em { color: var(--muted); }        /* journal name */

.pub-links {
  margin-top: var(--s-2);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
}
.pub-links a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  border-bottom: 1.5px solid transparent;
  transition: border-color .15s ease;
}
.pub-links a:hover { border-bottom-color: var(--accent); }

/* ============================================================
   GET INVOLVED PAGE
   ============================================================ */
.involve-list { display: flex; flex-direction: column; gap: var(--s-6); }
.involve-section {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: var(--s-7); box-shadow: var(--shadow);
}
.involve-section::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0;
  width: 4px; background: var(--sage);
}
.involve-section:nth-child(2)::before { background: var(--apple); }
.involve-section:nth-child(3)::before { background: var(--accent); }
.involve-title { margin: 0 0 var(--s-3); font-size: 1.4rem; letter-spacing: -0.01em; color: var(--text); }
.involve-section p { margin: 0 0 var(--s-3); color: var(--text); }
.involve-section p:last-child { margin-bottom: 0; }
.involve-note { color: var(--muted); font-size: 0.95rem; }
.involve-actions { margin-top: var(--s-5); display: flex; flex-wrap: wrap; gap: var(--s-4); }
.involve-actions a {
  color: var(--accent); text-decoration: none; font-weight: 500; font-size: 0.95rem;
  border-bottom: 1.5px solid transparent; transition: border-color .15s ease;
}
.involve-actions a:hover { border-bottom-color: var(--accent); }
@media (max-width: 760px) { .involve-section { padding: var(--s-5); } }

/* ============================================================
   ACTION / LINK GROUPS — clearer separation between links
   (Get Involved, PI links, People modals, Research & Pubs)
   ============================================================ */
.involve-actions,
.pi-links,
.paper-links,
.pub-links,
.modal-links {
  align-items: center;
  gap: var(--s-2) var(--s-4);
}
.involve-actions a + a::before,
.pi-links a + a::before,
.paper-links a + a::before,
.pub-links a + a::before,
.modal-links a + a::before {
  content: "";
  display: inline-block;
  width: 1px;
  height: 0.95em;
  background: var(--border-strong);
  margin-right: var(--s-4);
  vertical-align: -0.1em;
  border-bottom: none;
}

/* ============================================================
   VIBRANT ENHANCEMENTS
   ============================================================ */
:root {
  --area-eval:   #5c8a55;   /* green  — Evaluation */
  --area-advice: #b23a30;   /* red    — Advice & Learning */
  --area-help:   #2f6f95;   /* blue   — Helping Behavior */
}


/* color-coded research areas — homepage cards */
.research-grid .research-card::before { opacity: 1; }
.research-grid .research-card:nth-child(1)::before { background: var(--area-eval); }
.research-grid .research-card:nth-child(2)::before { background: var(--area-advice); }
.research-grid .research-card:nth-child(3)::before { background: var(--area-help); }

/* color-coded research areas — Research page rows */
.research-row { position: relative; overflow: hidden; }
.research-row::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 6px;
  z-index: 3;
}
.research-list .research-row:nth-child(1)::before { background: var(--area-eval); }
.research-list .research-row:nth-child(2)::before { background: var(--area-advice); }
.research-list .research-row:nth-child(3)::before { background: var(--area-help); }

/* chunky brown button borders removed to match the softer hero/card outline */

/* action links: underline only the text on hover (not the separator/gap) */
.involve-actions a,
.pi-links a,
.paper-links a,
.pub-links a,
.modal-links a {
  border-bottom: 0 !important;
}
.involve-actions a:hover,
.pi-links a:hover,
.paper-links a:hover,
.pub-links a:hover,
.modal-links a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
}

/* static (non-clickable) people cards — e.g. RAs with no bio */
.person-card--static { cursor: default; }
.person-card--static:hover {
  transform: none;
  box-shadow: var(--shadow);
  border-color: var(--brown-strong);
}
