/* ==========================================================================
   MATRIX Lab - stylesheet
   Light, minimalist, technical. All color decisions live in :root below,
   so re-theming the entire site is a few lines of editing.
   ========================================================================== */

:root {
  /* --- Surfaces (light throughout) --- */
  --paper:      #fcfcfd;   /* page background */
  --paper-warm: #f5f7fa;   /* alternating sections, page headers */
  --paper-tint: #eef2f8;   /* hero wash */
  --card:       #ffffff;

  /* --- Ink --- */
  --ink:    #101418;       /* headings + body */
  --ink-2:  #39424f;       /* secondary body */
  --muted:  #616d7e;       /* captions, labels */
  --line:   #e4e8ef;       /* hairlines */
  --line-2: #d3dae4;       /* stronger hairlines */

  /* --- Accents --- */
  --brand:      #c31431;   /* UMD-inspired red: links, accents */
  --brand-dark: #8f0d23;
  --brand-soft: rgba(195, 20, 49, .07);
  --cool:       #4a6fa5;   /* cool secondary, used only in graphics */

  /* --- Type --- */
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --mono:  "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;

  /* --- Layout --- */
  --maxw: 1140px;
  --radius: 10px;
}

/* --- Baseline --- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.68;
  color: var(--ink-2);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

h1, h2, h3, h4 {
  font-family: var(--serif); font-weight: 600; line-height: 1.18;
  color: var(--ink); margin: 0 0 .5em; letter-spacing: -.015em;
}
h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.55rem, 3vw, 2rem); }
h3 { font-size: 1.13rem; letter-spacing: -.005em; }
p  { margin: 0 0 1.15em; }
ul, ol { margin: 0 0 1.15em; padding-left: 1.25em; }
li { margin-bottom: .45em; }
strong { color: var(--ink); font-weight: 600; }
code {
  font-family: var(--mono); font-size: .86em; color: var(--ink);
  background: var(--paper-warm); border: 1px solid var(--line);
  border-radius: 5px; padding: .12em .42em;
}
hr { border: 0; border-top: 1px solid var(--line); margin: 3rem 0; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }
.narrow { max-width: 790px; }

/* ==========================================================================
   Header / navigation
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(252,252,253,.86);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 66px; gap: 20px; }

.brand {
  display: flex; align-items: baseline; gap: .5rem; flex: none;
  font-family: var(--serif); font-size: 1.2rem; font-weight: 700;
  color: var(--ink); letter-spacing: -.02em;
}
.brand:hover { text-decoration: none; }
.brand .dot { width: 8px; height: 8px; border-radius: 2px; background: var(--brand); display: inline-block; }
.brand small {
  font-family: var(--mono); font-size: .64rem; font-weight: 500; color: var(--muted);
  letter-spacing: .1em; text-transform: uppercase;
}

.nav-links { display: flex; gap: 1px; list-style: none; margin: 0; padding: 0; }
.nav-links li { margin: 0; }
.nav-links a {
  display: block; padding: 7px 10px; border-radius: 7px;
  color: var(--ink-2); font-size: .855rem; font-weight: 500; white-space: nowrap;
}
.nav-links a:hover { background: var(--paper-warm); color: var(--ink); text-decoration: none; }
.nav-links a.active { color: var(--brand); background: var(--brand-soft); }

.nav-toggle {
  display: none; background: none; border: 1px solid var(--line-2); border-radius: 8px;
  padding: 7px 11px; cursor: pointer; font-size: 1rem; line-height: 1; color: var(--ink);
}

@media (max-width: 1060px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none; position: absolute; top: 66px; left: 0; right: 0;
    flex-direction: column; gap: 0; padding: 8px 20px 18px;
    background: var(--paper); border-bottom: 1px solid var(--line);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 11px 8px; font-size: .95rem; }
}
@media (max-width: 420px) { .brand small { display: none; } }

/* ==========================================================================
   Hero (light)
   ========================================================================== */
.hero {
  background:
    linear-gradient(180deg, var(--paper-tint) 0%, var(--paper) 88%);
  border-bottom: 1px solid var(--line);
  padding: 84px 0 78px;
  position: relative; overflow: hidden;
}
.hero-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 56px; align-items: center; }
@media (max-width: 940px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-figure { display: none; }
}
.hero h1 { margin-bottom: .22em; }
.hero .expansion {
  font-family: var(--sans); font-size: clamp(1rem, 2vw, 1.16rem);
  color: var(--muted); margin-bottom: 1.5em; max-width: 46ch;
}
.hero .expansion b { color: var(--brand); font-weight: 600; }
.hero .mission { font-size: 1.07rem; color: var(--ink-2); max-width: 60ch; }
.tagline {
  font-family: var(--serif); font-style: italic; font-size: 1.22rem; color: var(--ink);
  border-left: 2px solid var(--brand); padding-left: 1.1rem; margin: 2.1rem 0 0;
}

/* mono micro-labels give the site its technical register */
.eyebrow, .kicker, .lbl {
  font-family: var(--mono); font-size: .68rem; font-weight: 500;
  letter-spacing: .16em; text-transform: uppercase;
}
.eyebrow { display: inline-block; color: var(--brand); margin-bottom: 1.15rem; }
.kicker  { display: block; color: var(--brand); margin-bottom: .8rem; }

/* --- Buttons --- */
.btn {
  display: inline-block; padding: 10px 19px; border-radius: 8px;
  font-size: .9rem; font-weight: 600; border: 1px solid transparent; cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-outline { border-color: var(--line-2); color: var(--ink); background: var(--card); }
.btn-outline:hover { border-color: var(--brand); color: var(--brand); }
.btn-row { display: flex; flex-wrap: wrap; gap: 11px; margin-top: 2.1rem; }

/* ==========================================================================
   Sections
   ========================================================================== */
section { padding: 84px 0; }
section.soft {
  background: var(--paper-warm);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.section-head { max-width: 70ch; margin-bottom: 2.8rem; }
.section-head p { color: var(--muted); margin-bottom: 0; }

/* Interior page header */
.page-head {
  background: linear-gradient(180deg, var(--paper-tint), var(--paper-warm));
  border-bottom: 1px solid var(--line); padding: 58px 0 50px;
}
.page-head h1 { margin-bottom: .28em; }
.page-head p { color: var(--muted); max-width: 68ch; margin-bottom: 0; }

/* --- Grids & cards --- */
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(275px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 26px 28px;
  transition: border-color .18s ease, transform .18s ease;
}
.card:hover { border-color: var(--line-2); transform: translateY(-2px); }
.card h3 { margin-bottom: .5em; }
.card p:last-child { margin-bottom: 0; }
.card .icon {
  width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand); margin-bottom: 15px;
}
.card .icon svg { width: 19px; height: 19px; }
.card .role { color: var(--brand); font-weight: 600; font-size: .87rem; margin-bottom: .9em; }

/* Stat tiles */
.stat { text-align: center; padding: 26px 16px; }
.stat .num { font-family: var(--serif); font-size: 2.15rem; font-weight: 600; color: var(--ink); line-height: 1; }
.stat .lbl { display: block; color: var(--muted); margin-top: .7rem; }

/* --- News list --- */
.news { list-style: none; padding: 0; margin: 0; }
.news li {
  display: grid; grid-template-columns: 112px 1fr; gap: 20px;
  padding: 17px 0; border-top: 1px solid var(--line); margin: 0;
}
.news li:last-child { border-bottom: 1px solid var(--line); }
.news time { font-family: var(--mono); font-size: .78rem; color: var(--muted); padding-top: .3em; }
.news p { margin: 0; }
@media (max-width: 620px) { .news li { grid-template-columns: 1fr; gap: 5px; } }

/* --- People --- */
.person { display: grid; grid-template-columns: 190px 1fr; gap: 34px; align-items: start; }
.person img, .person .avatar {
  width: 190px; height: 232px; object-fit: cover; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--paper-warm);
}
.avatar {
  display: grid; place-items: center; color: var(--muted);
  font-family: var(--mono); font-size: .7rem; text-align: center; padding: 14px; line-height: 1.6;
}
.person h3 { margin-bottom: .18em; font-size: 1.3rem; }
.person .role { color: var(--brand); font-weight: 600; font-size: .9rem; margin-bottom: 1.1em; }
@media (max-width: 700px) { .person { grid-template-columns: 1fr; gap: 20px; } }

.member { text-align: center; }
.member .avatar, .member img { width: 100%; height: 190px; margin-bottom: 15px; }
.member h3 { font-size: 1rem; margin-bottom: .12em; }
.member .role { font-size: .82rem; color: var(--muted); margin: 0; }

/* --- Compact roster lists: undergraduates, high school researchers, alumni --- */
.roster { list-style: none; padding: 0; margin: 1.4rem 0 0; columns: 2; column-gap: 34px; }
.roster li {
  break-inside: avoid; margin-bottom: .55em; padding-bottom: .55em;
  border-bottom: 1px solid var(--line); font-size: .92rem; color: var(--muted);
}
.roster .roster-name { display: block; color: var(--ink); font-weight: 600; }
@media (max-width: 700px) { .roster { columns: 1; } }

/* --- Entry lists: publications, grants, courses, mentee projects --- */
.pub-list { list-style: none; padding: 0; margin: 0; }
.pub-list > li { padding: 24px 0; border-top: 1px solid var(--line); margin: 0; }
.pub-list > li:last-child { border-bottom: 1px solid var(--line); }
.pub-title {
  font-family: var(--serif); font-size: 1.12rem; font-weight: 600;
  display: block; margin-bottom: .32em; color: var(--ink);
}
.pub-authors { color: var(--muted); font-size: .92rem; margin-bottom: .3em; }
.pub-authors .me { color: var(--ink); font-weight: 600; }
.pub-venue { font-size: .92rem; margin-bottom: 0; color: var(--muted); }
.pub-venue em { color: var(--ink); font-style: italic; }
.pub-note { font-size: .95rem; margin: .7em 0 0; }
.pub-links { margin-top: .7em; display: flex; flex-wrap: wrap; gap: 7px; }

.tag {
  display: inline-block; font-family: var(--mono); font-size: .68rem; font-weight: 500;
  letter-spacing: .05em; padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--paper-warm); color: var(--muted);
}
a.tag:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
.tag-hi { background: var(--brand-soft); border-color: rgba(195,20,49,.22); color: var(--brand); }
.tag-on { background: #e9f3ec; border-color: #c3e0cc; color: #1f6b3a; }   /* active / current */
.tag-off{ background: var(--paper-warm); border-color: var(--line); color: var(--muted); } /* completed */

/* --- Key/value rows --- */
.rows { border-top: 1px solid var(--line); }
.rows > div {
  display: grid; grid-template-columns: 178px 1fr; gap: 20px;
  padding: 15px 0; border-bottom: 1px solid var(--line);
}
.rows .k { font-family: var(--mono); font-size: .72rem; letter-spacing: .08em;
           text-transform: uppercase; color: var(--muted); padding-top: .35em; }
@media (max-width: 620px) { .rows > div { grid-template-columns: 1fr; gap: 3px; } .rows .k { padding-top: 0; } }

/* --- Callout --- */
.callout {
  background: var(--paper-warm); border: 1px solid var(--line);
  border-left: 2px solid var(--brand); border-radius: var(--radius); padding: 24px 28px;
}
.callout h3 { margin-top: 0; }
.callout p:last-child { margin-bottom: 0; }

/* --- Placeholder marker: obvious on screen, easy to grep for --- */
.todo {
  display: block; border: 1px dashed var(--line-2); border-radius: var(--radius);
  background: repeating-linear-gradient(135deg, transparent, transparent 9px, rgba(0,0,0,.014) 9px, rgba(0,0,0,.014) 18px);
  padding: 18px 22px; color: var(--muted); font-size: .93rem;
}
.todo::before {
  content: "PLACEHOLDER"; display: block; font-family: var(--mono); font-size: .62rem;
  letter-spacing: .16em; color: var(--brand); margin-bottom: .5em;
}
.todo p:last-child { margin-bottom: 0; }

/* ==========================================================================
   Footer (light)
   ========================================================================== */
.site-footer {
  background: var(--paper-warm); border-top: 1px solid var(--line);
  color: var(--muted); padding: 56px 0 30px; font-size: .9rem;
}
.site-footer h4 {
  font-family: var(--mono); font-size: .68rem; font-weight: 500; letter-spacing: .16em;
  text-transform: uppercase; color: var(--ink); margin-bottom: 1.1em;
}
.site-footer a { color: var(--ink-2); }
.site-footer a:hover { color: var(--brand); }
.footer-grid { display: grid; grid-template-columns: 1.7fr 1fr 1fr; gap: 40px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; gap: 30px; } }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: .55em; }
.footer-bottom {
  margin-top: 42px; padding-top: 22px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  font-family: var(--mono); font-size: .7rem; letter-spacing: .04em; color: var(--muted);
}

/* Accessibility */
.skip { position: absolute; left: -9999px; }
.skip:focus {
  left: 14px; top: 14px; background: var(--card); color: var(--ink);
  padding: 10px 16px; border-radius: 8px; border: 1px solid var(--line-2); z-index: 100;
}
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

@media print {
  .site-header, .site-footer, .btn-row, .nav-toggle { display: none; }
  body { font-size: 11pt; }
}

/* --- Hero figure: the sparse-matrix motif --- */
.hero-figure { justify-self: end; max-width: 300px; width: 100%; }
.hero-figure svg { display: block; overflow: visible; }
.figure-note {
  font-family: var(--mono); font-size: .62rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted);
  margin: 1.1rem 0 0; text-align: right;
}

/* --- Cards that are themselves links --- */
a.card { display: block; text-decoration: none; }
a.card:hover { text-decoration: none; border-color: var(--brand); }
a.card h3 { color: var(--ink); }
a.card .kicker { margin-bottom: .55rem; }
a.card p { color: var(--ink-2); }
