/* ============================================================
   Jason R. Marden — Academic Site
   Shared stylesheet. Edit design here once; all pages update.
   ============================================================ */

:root {
  --ink: #1a1a1a;
  --ink-soft: #3d3d3d;
  --muted: #6b6b6b;
  --line: #e5e5e0;
  --bg: #fafaf7;
  --paper: #ffffff;
  --accent: #003660;       /* UCSB navy */
  --accent-soft: #eef3f8;  /* pale navy tint */
  --accent-gold: #FEBC11;  /* UCSB gold (used sparingly) */
  --accent-gold-soft: #fff4d4;
  --serif: 'Crimson Pro', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 60px; }

body {
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
a:hover { border-bottom-color: var(--accent); }

/* ========== NAV ========== */
.nav {
  position: sticky;
  top: 0;
  background: rgba(250, 250, 247, 0.92);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
  z-index: 100;
}
.nav-inner {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.nav-brand {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
  letter-spacing: -0.01em;
  border: none;
}
.nav-links {
  display: flex;
  gap: 1.75rem;
  list-style: none;
  font-family: var(--sans);
  font-size: 0.88rem;
}
.nav-links a {
  color: var(--ink-soft);
  border: none;
  font-weight: 500;
  transition: color .2s;
}
.nav-links a:hover { color: var(--accent); }
.nav-links a.current { color: var(--accent); }
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.5rem;
  color: var(--ink);
}

/* ========== LAYOUT ========== */
main {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 2rem;
}

section {
  padding: 5rem 0 4rem;
  border-bottom: 1px solid var(--line);
}
section:last-of-type { border-bottom: none; }

/* Page header (for interior pages) */
.page-header {
  padding: 4rem 0 2.5rem;
  border-bottom: 1px solid var(--line);
}
.page-header .eyebrow {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
  margin-bottom: 0.6rem;
}
.page-header h1 {
  font-family: var(--serif);
  font-size: 2.6rem;
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--ink);
  line-height: 1.1;
}
.page-header p.lead {
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--ink-soft);
  margin-top: 1rem;
  max-width: 720px;
}

h2.section-title {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
  margin-bottom: 2rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--line);
}

/* ========== HERO ========== */
.hero {
  padding: 5rem 0 4rem;
  border-bottom: 1px solid var(--line);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 3.5rem;
  align-items: start;
}
.hero h1 {
  font-family: var(--serif);
  font-size: 3rem;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin-bottom: 0.6rem;
  color: var(--ink);
}
.hero .role {
  font-family: var(--sans);
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 1.6rem;
  font-weight: 400;
}
.hero .role strong { color: var(--ink-soft); font-weight: 500; }
.hero p.bio {
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--ink-soft);
  margin-bottom: 1.4rem;
}
.hero-photo {
  width: 100%;
  aspect-ratio: 2/3;
  background: var(--line);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.hero-photo img { width: 100%; height: 100%; object-fit: cover; }

.hero-meta {
  margin-top: 1.6rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem 2rem;
  font-family: var(--sans);
  font-size: 0.88rem;
  color: var(--muted);
}
.hero-meta span { display: inline-flex; align-items: center; gap: 0.4rem; }
.hero-meta a { color: var(--ink-soft); border: none; font-weight: 500; }
.hero-meta a:hover { color: var(--accent); }
.hero-meta .dot { color: var(--line); }

/* ========== GENERIC TEXT BLOCK ========== */
.text-block {
  font-size: 1.08rem;
  line-height: 1.75;
  color: var(--ink-soft);
  max-width: 720px;
}
.text-block p { margin-bottom: 1.2rem; }
.text-block p:last-child { margin-bottom: 0; }

/* ========== RESEARCH CARDS ========== */
.research-intro {
  font-size: 1.08rem;
  line-height: 1.75;
  color: var(--ink-soft);
  margin-bottom: 2.5rem;
  max-width: 720px;
}
.research-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}
.research-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1.75rem;
  cursor: pointer;
  transition: all .25s ease;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  text-align: left;
  font-family: var(--serif);
}
.research-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 54, 96, 0.10);
}
.research-card .num {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.15em;
}
.research-card h3 {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 500;
  line-height: 1.25;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.research-card p {
  font-size: 0.98rem;
  line-height: 1.6;
  color: var(--muted);
  flex-grow: 1;
}
.research-card .read-more {
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--accent);
  margin-top: 0.4rem;
}

/* ========== PROJECTS ========== */
.projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-top: 2rem;
}
.project-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1.75rem 2rem;
  cursor: pointer;
  transition: all .25s ease;
}
.project-card:hover {
  border-color: var(--accent);
  box-shadow: 0 6px 20px rgba(0,0,0,0.05);
}
.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  font-family: var(--sans);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 0.8rem;
}
.project-meta .tag {
  background: var(--accent-gold);
  color: var(--accent);
  padding: 0.2rem 0.6rem;
  border-radius: 3px;
  font-weight: 600;
}
.project-card h3 {
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}
.project-card p {
  color: var(--ink-soft);
  font-size: 1rem;
  line-height: 1.65;
}

/* ========== PUBLICATIONS ========== */
.pub-toggle {
  margin-bottom: 2rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.pub-toggle button {
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all .2s;
}
.pub-toggle button:hover { border-color: var(--ink-soft); }
.pub-toggle button.active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.pub-list { list-style: none; }
.pub-year-header {
  font-family: var(--sans);
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
  margin: 2.6rem 0 0.5rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--line);
  display: none;
}
.pub-year-header.show { display: block; }
.pub-year-header.first-shown { margin-top: 0; }
.pub-item {
  padding: 0.95rem 0;
  border-bottom: 1px solid var(--line);
  display: none;
  position: relative;
}
.pub-item:last-child { border-bottom: none; }
.pub-item.show { display: block; }
.pub-item .pub-title {
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.4;
  margin-bottom: 0.25rem;
}
.pub-item .pub-meta {
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
}
.pub-item .pub-meta em {
  font-style: italic;
  color: var(--ink-soft);
}
.pub-item .pub-award {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-gold-soft);
  padding: 0.05rem 0.45rem;
  border-radius: 3px;
  margin-left: 0.4rem;
  vertical-align: 0.1em;
  letter-spacing: 0.02em;
}
.pub-item .pub-actions {
  margin-top: 0.35rem;
  display: flex;
  gap: 0.85rem;
  font-family: var(--sans);
  font-size: 0.78rem;
  align-items: center;
}
.pub-item .pub-actions a,
.pub-item .pub-actions button.bib-trigger {
  color: var(--accent);
  border: none;
  background: none;
  font-weight: 500;
  font-family: var(--sans);
  font-size: 0.78rem;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.pub-item .pub-actions a:hover,
.pub-item .pub-actions button.bib-trigger:hover {
  border-bottom-color: var(--accent);
}
.pub-item .pub-actions button.bib-trigger {
  letter-spacing: 0.01em;
}

/* ========== BIBTEX MODAL ========== */
.bib-code {
  background: #f7f5ee;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1rem 1.2rem;
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--ink);
  white-space: pre;
  overflow-x: auto;
  margin: 0 0 1rem;
}
.bib-code code { font-family: inherit; }
.bib-toolbar {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.bib-copy {
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: var(--paper);
  border: 1px solid var(--accent);
  border-radius: 4px;
  cursor: pointer;
  transition: opacity .2s;
}
.bib-copy:hover { opacity: 0.9; }
.bib-copied {
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--accent);
  font-weight: 500;
  opacity: 0;
  transition: opacity .25s;
}
.bib-copied.show { opacity: 1; }

/* ========== STUDENTS ========== */
.students-block { margin-bottom: 2.8rem; }
.students-block:last-child { margin-bottom: 0; }
.students-block h3 {
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink);
  margin-bottom: 1.2rem;
}
.students-list {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem 2rem;
}
.students-list li {
  font-size: 1rem;
  line-height: 1.55;
  color: var(--ink-soft);
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--line);
}
.students-list li strong { color: var(--ink); font-weight: 600; }
.students-list li .placement {
  display: block;
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 0.15rem;
}
.students-list li .years {
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--muted);
}

/* ========== NEWS ========== */
.news-list { list-style: none; max-width: 760px; }
.news-item {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 1.4rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--line);
}
.news-item:last-child { border-bottom: none; }
.news-date {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  padding-top: 0.2rem;
}
.news-content {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink-soft);
}
.news-content strong { color: var(--ink); font-weight: 600; }

/* ========== AWARDS ========== */
.awards-list {
  list-style: none;
  columns: 2;
  column-gap: 2.5rem;
}
.awards-list li {
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line);
  break-inside: avoid;
  font-size: 0.98rem;
  line-height: 1.5;
  color: var(--ink-soft);
}
.awards-list .year {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: 0.15rem;
}

/* ========== CONTACT ========== */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}
.contact-block h3 {
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink);
  margin-bottom: 0.8rem;
}
.contact-block p {
  color: var(--ink-soft);
  font-size: 1rem;
  line-height: 1.7;
}

/* ========== CARD CTA (cross-page links on Home) ========== */
.cta-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-top: 1rem;
}
.cta-card {
  display: block;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1.5rem;
  border-bottom: 1px solid var(--line);
  transition: all .25s ease;
}
.cta-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 54, 96, 0.10);
}
.cta-card h3 {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 0.3rem;
}
.cta-card p {
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
}
.cta-card .arrow {
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  margin-top: 0.6rem;
  display: inline-block;
}

/* ========== MODAL ========== */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 26, 0.55);
  z-index: 200;
  padding: 2rem 1rem;
  overflow-y: auto;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.modal.show { display: flex; align-items: flex-start; justify-content: center; }
.modal-content {
  background: var(--paper);
  max-width: 720px;
  width: 100%;
  border-radius: 8px;
  margin: 2rem auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  animation: slideUp .35s ease;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--line);
}
.modal-header h3 {
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.modal-close {
  background: none;
  border: none;
  font-size: 1.6rem;
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
  padding: 0.2rem 0.5rem;
  transition: color .2s;
}
.modal-close:hover { color: var(--accent); }
.modal-body {
  padding: 2rem;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--ink-soft);
}
.modal-body h4 {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink);
  margin: 1.6rem 0 0.8rem;
}
.modal-body h4:first-child { margin-top: 0; }
.modal-body p { margin-bottom: 0.9rem; }
.modal-body ul { margin: 0.6rem 0 1rem 1.2rem; }
.modal-body li { margin-bottom: 0.5rem; }
.modal-body .highlight {
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  padding: 1rem 1.2rem;
  margin: 1.2rem 0;
  border-radius: 0 4px 4px 0;
}
.modal-body .highlight h5 {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 0.4rem;
}

/* ========== FOOTER ========== */
footer {
  text-align: center;
  padding: 3rem 2rem;
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
  margin-top: 2rem;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  body { font-size: 17px; }
  .nav-inner { padding: 0 1.25rem; }
  .nav-links {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--paper);
    flex-direction: column;
    padding: 1rem 1.5rem;
    gap: 0.8rem;
    border-bottom: 1px solid var(--line);
  }
  .nav-links.open { display: flex; }
  .nav-toggle { display: block; }
  main { padding: 0 1.25rem; }
  section { padding: 3rem 0 2.5rem; }
  .hero { padding: 3rem 0 2.5rem; }
  .page-header { padding: 2.5rem 0 1.8rem; }
  .page-header h1 { font-size: 2rem; }
  .hero-grid { grid-template-columns: 1fr; gap: 2rem; }
  .hero-photo { max-width: 200px; order: -1; }
  .hero h1 { font-size: 2.2rem; }
  .research-grid { grid-template-columns: 1fr; }
  .students-list { grid-template-columns: 1fr; }
  .awards-list { columns: 1; }
  .contact-grid { grid-template-columns: 1fr; gap: 2rem; }
  .news-item { grid-template-columns: 1fr; gap: 0.4rem; }
  .cta-row { grid-template-columns: 1fr; }
}

/* ========== COURSE CARDS (Teaching page) ========== */
.research-card.course-card { cursor: default; }
.research-card.course-card:hover {
  transform: none;
  border-color: var(--accent);
  box-shadow: 0 4px 14px rgba(139, 26, 26, 0.05);
}
