/* ============================================================
   Design tokens
   Palette: lab-notebook paper + deep teal + chromatography amber
   Type: Fraunces (display) / Inter (body) / IBM Plex Mono (data)
   ============================================================ */
:root {
  --paper:      #F7F6F2;
  --paper-alt:  #EFECE2;
  --ink:        #14181D;
  --ink-soft:   #4A5158;
  --ink-faint:  #7A8087;
  --teal:       #1E5F5B;
  --teal-dark:  #143F3D;
  --amber:      #C08A2E;
  --clay:       #9F5C48;
  --line:       #DDD9CE;
  --line-strong:#C7C2B4;
  --max-w:      760px;
  --max-w-wide: 1040px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:      #14181D;
    --paper-alt:  #1B2026;
    --ink:        #ECEAE4;
    --ink-soft:   #B7BCC2;
    --ink-faint:  #7A8087;
    --teal:       #5FB8B0;
    --teal-dark:  #8FD4CC;
    --amber:      #E0B15C;
    --clay:       #D48A72;
    --line:       #2B3138;
    --line-strong:#3A414A;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4 {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  line-height: 1.15;
  color: var(--ink);
  margin: 0 0 0.4em;
}

h1 { font-size: 2.6rem; font-optical-sizing: auto; }
h2 { font-size: 1.7rem; margin-top: 2.6em; }
h3 { font-size: 1.2rem; margin-top: 1.6em; }

p { margin: 0 0 1.1em; color: var(--ink-soft); }

a {
  color: var(--teal);
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
}
a:hover { color: var(--amber); }

code, .mono, .eyebrow, time, .tag, .doi {
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

.eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--ink-faint);
  display: block;
  margin-bottom: 0.6em;
}

/* ---------- Layout shells ---------- */
.wrap        { max-width: var(--max-w);      margin: 0 auto; padding: 0 24px; }
.wrap-wide   { max-width: var(--max-w-wide);  margin: 0 auto; padding: 0 24px; }

/* ---------- Nav ---------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-nav .bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  max-width: var(--max-w-wide);
  margin: 0 auto;
}
.site-nav .brand {
  font-family: "Fraunces", serif;
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--ink);
  text-decoration: none;
}
.site-nav .brand:hover { color: var(--ink); }
.site-nav .links { display: flex; gap: 22px; align-items: center; }
.site-nav .links a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
}
.site-nav .links a:hover, .site-nav .links a.active { color: var(--teal); }
.site-nav .links a.active { border-bottom: 2px solid var(--amber); padding-bottom: 3px; }

/* ---------- Hero ---------- */
.hero {
  padding: 76px 0 54px;
  border-bottom: 1px solid var(--line);
  background-image: radial-gradient(var(--line) 1px, transparent 1px);
  background-size: 22px 22px;
  background-position: -8px -8px;
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
  gap: 48px;
  align-items: center;
}
@media (max-width: 780px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-panel { order: -1; }
}
.hero h1 { margin-bottom: 0.15em; }
.hero .role { color: var(--teal); font-size: 1.1rem; margin-bottom: 1.1em; font-weight: 500; }
.hero .links-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 1.6em; }
.hero .links-row a {
  font-size: 0.88rem;
  text-decoration: none;
  border: 1px solid var(--line-strong);
  padding: 7px 14px;
  border-radius: 3px;
  color: var(--ink);
}
.hero .links-row a:hover { border-color: var(--teal); color: var(--teal); }
.hero-panel {
  display: grid;
  gap: 18px;
  align-self: stretch;
}
.profile-card {
  border: 1px solid var(--line-strong);
  background: color-mix(in srgb, var(--paper-alt) 82%, var(--paper));
  padding: 20px 22px;
}
.profile-card dl { margin: 0; display: grid; gap: 14px; }
.profile-card dt {
  color: var(--ink);
  font-weight: 600;
  font-size: 0.92rem;
}
.profile-card dd {
  color: var(--ink-soft);
  margin: 2px 0 0;
  font-size: 0.92rem;
  line-height: 1.5;
}
.portrait-card {
  margin: 0;
  border: 1px solid var(--line);
  background: var(--paper-alt);
  padding: 14px;
}
.portrait-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center top;
}
.portrait-card figcaption,
.media-grid figcaption {
  color: var(--ink-faint);
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem;
  line-height: 1.45;
  margin-top: 10px;
}

/* ---------- Sections ---------- */
main { padding: 56px 0 90px; }
section + section { margin-top: 3em; }
hr.rule { border: none; border-top: 1px solid var(--line); margin: 2.4em 0; }

/* ---------- Homepage highlights ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 1.2em 0 1.6em;
}
.stat {
  border-top: 3px solid var(--teal);
  background: var(--paper-alt);
  padding: 16px 16px 18px;
  min-height: 132px;
}
.stat:nth-child(2) { border-top-color: var(--amber); }
.stat:nth-child(3) { border-top-color: var(--clay); }
.stat strong {
  display: block;
  font-family: "Fraunces", Georgia, serif;
  font-size: 2.05rem;
  line-height: 1;
  margin-bottom: 10px;
}
.stat span {
  display: block;
  color: var(--ink-soft);
  font-size: 0.86rem;
  line-height: 1.45;
}
.feature-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin: 1.2em 0 1.4em;
}
.feature-list article {
  border-top: 3px solid var(--teal);
  background: var(--paper-alt);
  border-radius: 4px;
  padding: 20px 22px 22px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.feature-list article:nth-child(2) { border-top-color: var(--amber); }
.feature-list article:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.12);
}
.feature-list h3 { margin: 0.35em 0 0.3em; }
.feature-list p { margin-bottom: 0; color: var(--ink-soft); }
@media (max-width: 720px) {
  .stat-grid { grid-template-columns: 1fr; }
  .stat { min-height: auto; }
  .feature-list { grid-template-columns: 1fr; }
}

/* ---------- Recognition gallery ---------- */
.recognition-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 1.4em;
}
.recognition-grid figure {
  margin: 0;
  border: 1px solid var(--line);
  background: var(--paper-alt);
  padding: 12px;
}
.recognition-grid img,
.recognition-grid object {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: var(--paper);
}
.recognition-grid figcaption {
  color: var(--ink-faint);
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem;
  line-height: 1.45;
  margin-top: 10px;
}
@media (max-width: 760px) {
  .recognition-grid { grid-template-columns: 1fr; }
}

/* ---------- Timeline (experience) ---------- */
.timeline { border-left: 2px solid var(--line); padding-left: 22px; margin: 1.6em 0; }
.timeline-item { position: relative; padding-bottom: 1.7em; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: -27px;
  top: 6px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--amber);
  border: 2px solid var(--paper);
  box-shadow: 0 0 0 1px var(--amber);
}
.timeline-item .role { font-weight: 600; color: var(--ink); }
.timeline-item .org { color: var(--ink-soft); }
.timeline-item time { font-size: 0.82rem; color: var(--ink-faint); }

/* ---------- Skill groups ---------- */
.skill-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px 32px; margin-top: 1.2em; }
@media (max-width: 640px) { .skill-grid { grid-template-columns: 1fr; } }
.skill-group .eyebrow { margin-bottom: 0.5em; }
.skill-group p { margin: 0; color: var(--ink); font-size: 0.95rem; }

/* ---------- Publication cards ---------- */
.pub {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 22px 24px;
  margin-bottom: 20px;
  background: var(--paper-alt);
}
.pub h3 { margin-top: 0; }
.pub .venue { color: var(--ink-faint); font-size: 0.85rem; margin-bottom: 0.8em; }
.pub ul { margin: 0.6em 0 0.9em; padding-left: 1.2em; }
.pub li { color: var(--ink-soft); margin-bottom: 0.35em; }
.pub .meta-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 0.8em; }
.tag {
  font-size: 0.72rem;
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--ink-soft);
  padding: 2px 8px;
  border-radius: 20px;
}
.pub .doi a { font-size: 0.82rem; }

/* ---------- Research media ---------- */
.event-feature {
  margin-bottom: 2.2em;
}
.event-feature h2,
.linkedin-section h2 {
  margin-top: 0;
}
.media-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 18px;
  margin: 1.3em 0 0;
}
.media-grid figure {
  margin: 0;
  border: 1px solid var(--line);
  background: var(--paper-alt);
  padding: 12px;
}
.media-grid img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}
.media-grid figure:nth-child(2) img {
  object-position: center;
}
.linkedin-section {
  margin: 2.2em 0;
}
.linkedin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 1.1em;
}
.linkedin-card {
  border: 1px solid var(--line);
  background: var(--paper-alt);
  display: grid;
  grid-template-rows: auto 1fr;
}
.linkedin-card img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}
.linkedin-card div {
  padding: 16px;
}
.linkedin-card h3 { margin-top: 0; }
.linkedin-card p { font-size: 0.92rem; }
@media (max-width: 760px) {
  .media-grid,
  .linkedin-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Blog list ---------- */
.post-list-item { padding: 20px 0; border-bottom: 1px solid var(--line); }
.post-list-item:first-child { padding-top: 0; }
.post-list-item h3 { margin: 0.15em 0 0.3em; }
.post-list-item time { color: var(--ink-faint); font-size: 0.82rem; }
.post-list-item p { margin: 0.4em 0 0; }

/* ---------- Single post ---------- */
.post-header { margin-bottom: 1.6em; }
.post-header time { color: var(--ink-faint); }
.post-content h2 { font-size: 1.35rem; }
.post-content img { max-width: 100%; border-radius: 4px; }
.post-content blockquote {
  border-left: 3px solid var(--amber);
  margin: 1.4em 0;
  padding: 0.2em 1.2em;
  color: var(--ink-soft);
  font-style: italic;
}
.back-link { display: inline-block; margin-top: 2.5em; font-size: 0.9rem; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 34px 0 50px;
  color: var(--ink-faint);
  font-size: 0.86rem;
}
.site-footer a { color: var(--ink-faint); }
.site-footer a:hover { color: var(--teal); }
.site-footer .links-row { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 0.6em; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- Focus visibility ---------- */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}
