/* mristic.space
   Kept from the original Astral (HTML5 UP) design: the doodle background, the white card
   floating on it, the #60C689 green, and the Source Sans typeface. */

:root {
  --ink: #1d2823;
  --text: #34403a;
  --muted: #5a6761;
  --line: #e1e7e3;
  --card: #fff;
  --tint: #f0f8f3;
  --tint-strong: #dcf1e5;
  --brand: #60c689;          /* the site's green: fills, icons, accents */
  --brand-hover: #4fb878;
  --brand-ink: #1e7748;      /* same hue, dark enough for text on white (5.5:1) */
  --brand-ink-hover: #145a35;
  --on-brand: #0f2e1d;       /* text on a --brand fill (7:1) */
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(15, 25, 20, .06), 0 18px 40px -18px rgba(15, 25, 20, .28);
  --font: 'Source Sans 3', 'Source Sans Pro', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --pad: 52px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 400 18px/1.65 var(--font);
  color: var(--text);
  background-color: #fff;
  background-image: url("../img/overlay.png"), url("../img/bg.webp");
  background-repeat: repeat;
  background-size: auto, 100%;
  background-attachment: fixed;
}
@media (max-width: 760px) {
  :root { --pad: 22px; }
  body { font-size: 17px; background-attachment: scroll; }
}

/* Crossfade between pages where supported; nothing ever waits for images or embeds. */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .2s; }
.site-nav { view-transition-name: site-nav; }
.site-footer { view-transition-name: site-footer; }

h1, h2, h3 { color: var(--ink); line-height: 1.2; margin: 0 0 .5em; letter-spacing: -0.01em; font-weight: 600; }
h1 { font-size: clamp(2.1rem, 1.5rem + 2vw, 2.8rem); }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
a { color: var(--brand-ink); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--brand-ink-hover); }
strong { color: var(--ink); font-weight: 600; }
em { font-style: italic; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
img { max-width: 100%; height: auto; }
.i { width: 1.15em; height: 1em; fill: currentColor; vertical-align: -0.14em; flex: none; }

.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; }
.skip:focus { top: 12px; color: #fff; }

/* ---- Layout --------------------------------------------------------------------------- */

.shell { max-width: 980px; margin: 0 auto; padding: 22px 20px 36px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid rgba(0, 0, 0, .05); overflow: hidden; }
.page-body { padding: 44px var(--pad) var(--pad); }
.page-head { margin-bottom: 26px; }
.lead { font-size: 1.12rem; color: var(--muted); max-width: 46em; }
.eyebrow { font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
.section-title { font-size: 1.35rem; margin: 40px 0 18px; padding-top: 30px; border-top: 1px solid var(--line); }
.section-title.first { margin-top: 8px; }
@media (max-width: 760px) {
  .shell { padding: 12px 12px 28px; }
  .page-body { padding-top: 30px; }
}

/* ---- Navigation: labelled pill floating above the card --------------------------------- */

.site-nav { position: sticky; top: 12px; z-index: 20; display: flex; justify-content: center; margin: 0 0 20px; }
.site-nav ul { list-style: none; margin: 0; padding: 6px; display: flex; gap: 2px; background: rgba(255, 255, 255, .94); -webkit-backdrop-filter: saturate(1.4) blur(8px); backdrop-filter: saturate(1.4) blur(8px); border-radius: 999px; box-shadow: var(--shadow); border: 1px solid rgba(0, 0, 0, .05); }
.site-nav a { display: flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px; color: var(--ink); font-weight: 600; font-size: 16px; line-height: 1.2; text-decoration: none; transition: background-color .15s, color .15s; }
.site-nav a .i { color: var(--brand); width: 1.2em; height: 1.05em; }
.site-nav a:hover { background: var(--tint); color: var(--ink); }
.site-nav a[aria-current="page"] { background: var(--tint-strong); color: var(--brand-ink); }
.site-nav a[aria-current="page"] .i { color: var(--brand-ink); }
.site-nav .ext { margin-left: 4px; padding-left: 6px; border-left: 1px solid var(--line); }
.site-nav .ext a { padding: 9px 12px; }
@media (max-width: 860px) {
  .site-nav { position: static; margin-bottom: 12px; }
  .site-nav ul { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; border-radius: 18px; gap: 4px; background: #fff; }
  .site-nav a { flex-direction: column; gap: 3px; padding: 8px 4px; font-size: 14px; border-radius: 12px; }
  .site-nav a .i { width: 1.4em; height: 1.25em; }
  .site-nav .ext { display: none; }
}

/* ---- Buttons, chips, badges ------------------------------------------------------------ */

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 1.4em 0 0; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 18px; border-radius: 999px; border: 1px solid #d3ddd7; background: #fff; color: var(--ink); font: 600 16px/1.2 var(--font); text-decoration: none; cursor: pointer; transition: background-color .15s, border-color .15s, color .15s; }
.btn:hover { border-color: var(--brand); background: var(--tint); color: var(--ink); }
.btn .i { color: var(--brand-ink); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn-primary .i { color: var(--on-brand); }
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: var(--on-brand); }
.btn-sm { padding: 6px 14px; font-size: 15px; }
.btn-ghost { border-color: transparent; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { padding: 4px 13px; border-radius: 999px; background: var(--tint); border: 1px solid #d6eedf; color: var(--ink); font-size: .92rem; }
.badge { display: inline-block; margin-left: 4px; padding: 1px 8px; border-radius: 999px; background: var(--tint-strong); color: var(--brand-ink); font-size: .7rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; font-style: normal; vertical-align: 1px; }
.link-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.link-chips a { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; background: var(--tint); color: var(--brand-ink); text-decoration: none; font-size: .9rem; font-weight: 600; line-height: 1.35; }
.link-chips a:hover { background: var(--tint-strong); }

/* ---- Home -------------------------------------------------------------------------------- */

.hero { text-align: center; padding: 48px var(--pad) 34px; }
.avatar { display: block; width: 240px; height: 240px; margin: 0 auto 20px; border-radius: 26px; object-fit: cover; border: 5px solid #fff; box-shadow: 0 0 0 3px var(--brand), var(--shadow); }
@media (max-width: 560px) {
  .avatar { width: 210px; height: 210px; border-radius: 22px; }
  .roles .role { display: block; }
  .roles .sep { display: none; }
}
.hero h1 { margin-bottom: .2em; }
.roles { color: var(--muted); font-size: 1.12rem; line-height: 1.5; margin-bottom: 14px; }
.icon-row { list-style: none; padding: 0; margin: 0 0 20px; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.icon-row a { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--tint); color: var(--brand-ink); transition: background-color .15s, color .15s; }
.icon-row a:hover { background: var(--brand); color: var(--on-brand); }
.hero .bio { max-width: 40em; margin: 0 auto; font-size: 1.04rem; }
.hero .actions { justify-content: center; }
.roles .affiliation { display: block; }
@media (max-width: 560px) {
  .icon-row { gap: 8px; }
  .icon-row a { width: 40px; height: 40px; }
}
.band { padding: 26px var(--pad); border-top: 1px solid var(--line); }
.band:last-child { padding-bottom: 36px; }
.band-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 0 12px; }
.more { font-weight: 600; font-size: .95rem; text-decoration: none; white-space: nowrap; margin-bottom: 12px; }
.mini-pubs { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.mini-pub { display: grid; gap: 2px; padding-left: 14px; border-left: 3px solid var(--line); }
.mini-pub.is-first { border-left-color: var(--brand); }
.mini-pub .pub-title { font-size: 1.02rem; }

/* ---- Research ------------------------------------------------------------------------------ */

.prose { max-width: 46em; }
.prose p { font-size: 1.06rem; }
.features { display: grid; gap: 22px; }
.feature { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.25fr); border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.feature-fig { display: grid; place-items: center; padding: 18px; border-right: 1px solid var(--line); }
.feature:nth-child(even) .feature-fig { order: 2; border-right: 0; border-left: 1px solid var(--line); }
.feature-fig img { width: 100%; height: auto; max-height: 300px; object-fit: contain; }
.feature-body { padding: 22px 26px; align-self: center; }
.feature-body .eyebrow { margin-bottom: 8px; }
.feature-body h3 { font-size: 1.18rem; margin-bottom: .45em; }
.feature-body h3 a { color: var(--ink); text-decoration: none; }
.feature-body h3 a:hover { color: var(--brand-ink); text-decoration: underline; }
.excerpt { font-size: .98rem; }
.feature-links { display: flex; gap: 8px; margin: 0; }
.news-links { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 12px 0 0; font-size: .88rem; }
.news-links span { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; }
.news-links span .i { color: var(--brand); }
.news-links a { padding: 2px 10px; border-radius: 999px; background: var(--tint); color: var(--brand-ink); font-weight: 600; text-decoration: none; }
.news-links a:hover { background: var(--tint-strong); }
.pub > .news-links { grid-column: 2; margin-top: 6px; }
.cta { margin: 30px 0 0; text-align: center; }
@media (max-width: 760px) {
  .feature { grid-template-columns: 1fr; }
  .feature-fig, .feature:nth-child(even) .feature-fig { order: 0; border: 0; border-bottom: 1px solid var(--line); }
  .feature-body { padding: 18px 20px; }
}

/* ---- Publications ------------------------------------------------------------------------ */

.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 10px; }
.metric { background: var(--tint); border: 1px solid #d6eedf; border-radius: var(--radius-sm); padding: 14px 10px 12px; text-align: center; }
.metric-value { display: block; font-size: 2rem; font-weight: 700; color: var(--ink); line-height: 1.1; font-variant-numeric: tabular-nums; }
.metric-label { font-size: .76rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.metrics-note { font-size: .88rem; color: var(--muted); margin-bottom: 26px; }
@media (max-width: 560px) { .metrics { grid-template-columns: repeat(2, 1fr); } }

.pub-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.seg { display: inline-flex; padding: 3px; background: #eef2f0; border-radius: 999px; }
.seg button { border: 0; background: transparent; font: 600 15px/1.2 var(--font); color: var(--muted); padding: 7px 15px; border-radius: 999px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .14); }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; color: var(--ink); cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--brand-ink); }
.pub-count { margin-left: auto; color: var(--muted); font-size: .9rem; }

.pubs { list-style: none; margin: 0; padding: 0; }
.year-sep { padding: 20px 0 6px; color: var(--muted); font-size: .85rem; font-weight: 700; letter-spacing: .08em; border-bottom: 1px dashed var(--line); }
.pub { display: grid; grid-template-columns: 200px minmax(0, 1fr); grid-template-areas: "thumb title" "thumb authors" "thumb venue" "thumb links"; column-gap: 24px; row-gap: 2px; align-content: start; margin: 4px -14px 0; padding: 14px; border-radius: var(--radius-sm); }
.pub > .pub-thumb { grid-area: thumb; }
.pub > .pub-title { grid-area: title; }
.pub > .pub-authors { grid-area: authors; }
.pub > .pub-venue { grid-area: venue; }
.pub > .pub-links { grid-area: links; }
.pub.is-first { background: linear-gradient(90deg, var(--tint), rgba(240, 248, 243, 0) 70%); box-shadow: inset 3px 0 0 var(--brand); }
.pub-thumb { align-self: start; display: block; width: 200px; height: 150px; border: 1px solid var(--line); border-radius: 10px; background: #fff; overflow: hidden; transition: border-color .15s, box-shadow .15s; }
a.pub-thumb { cursor: zoom-in; }
a.pub-thumb:hover { border-color: var(--brand); box-shadow: 0 8px 20px -10px rgba(15, 25, 20, .45); }
.pub-thumb img { display: block; width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.pub-thumb.is-empty { display: grid; place-items: center; background: var(--tint); border-color: #d6eedf; color: var(--brand); font-size: 26px; }
.pub-title { font-weight: 600; font-size: 1.06rem; line-height: 1.35; color: var(--ink); text-decoration: none; }
.pub-title:hover { color: var(--brand-ink); text-decoration: underline; }
.pub-authors { font-size: .95rem; }
.pub-venue { color: var(--muted); font-size: .92rem; }
.pub-links { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 14px; margin-top: 6px; }
.pub-links a, .pub-links button { font: 600 .9rem/1.5 var(--font); color: var(--brand-ink); text-decoration: none; background: none; border: 0; padding: 0; cursor: pointer; }
.pub-links a:hover, .pub-links button:hover { text-decoration: underline; }
.pub-links .cites { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.pub-links .cites .i { width: .9em; color: var(--brand); }
.more-authors { font: 600 .85em/1.4 var(--font); color: var(--brand-ink); background: var(--tint); border: 0; border-radius: 999px; padding: 0 8px; cursor: pointer; }
@media (max-width: 760px) {
  .pub { grid-template-columns: 136px minmax(0, 1fr); column-gap: 16px; }
  .pub-thumb { width: 136px; height: 102px; }
}
@media (max-width: 560px) {
  .pub { grid-template-columns: 96px minmax(0, 1fr); column-gap: 14px; }
  .pub-thumb { width: 96px; height: 72px; }
  .pub-count { margin-left: 0; }
}

dialog { border: 0; border-radius: var(--radius); box-shadow: var(--shadow); padding: 0; width: min(700px, calc(100vw - 32px)); color: var(--text); }
dialog::backdrop { background: rgba(15, 25, 20, .45); }
dialog form { padding: 22px; }
dialog h2 { font-size: 1.2rem; }
dialog pre { font: 13px/1.5 var(--mono); background: #f6f8f7; border: 1px solid var(--line); border-radius: 10px; padding: 14px; overflow: auto; max-height: 55vh; margin: 0; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }
.fig-dialog { width: min(1100px, calc(100vw - 32px)); }
.fig-dialog form { padding: 16px; }
.fig-dialog img { display: block; width: 100%; height: auto; max-height: calc(100vh - 170px); object-fit: contain; border-radius: 8px; background: #fff; }
.fig-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }
.fig-foot p { flex: 1 1 280px; margin: 0; font-weight: 600; color: var(--ink); line-height: 1.35; }

/* ---- CV ---------------------------------------------------------------------------------- */

.glance-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 40px; }
.glance h3 { font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 6px 0 10px; }
.glance .timeline + h3 { margin-top: 22px; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.timeline li { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 12px; font-size: .97rem; line-height: 1.45; }
.when { color: var(--muted); font-size: .88rem; font-variant-numeric: tabular-nums; padding-top: 2px; }
.timeline small { display: block; color: var(--muted); font-size: .88rem; }
.cv-frame { position: relative; width: 100%; aspect-ratio: 8.5 / 11; max-height: 1150px; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: #f4f6f5; }
.cv-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; opacity: 0; transition: opacity .3s; }
.cv-frame.is-loaded iframe { opacity: 1; }
.cv-skeleton { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; color: var(--muted); text-align: center; padding: 20px; }
.spinner { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }
@media (max-width: 760px) {
  .glance-grid { grid-template-columns: 1fr; }
  .glance-grid > div + div h3:first-child { margin-top: 22px; }
  .timeline li { grid-template-columns: 96px minmax(0, 1fr); }
  .cv-frame { aspect-ratio: auto; height: 75vh; }
}

/* ---- Outreach -------------------------------------------------------------------------------- */

.outreach-feature { display: grid; gap: 22px; padding-bottom: 30px; margin-bottom: 26px; border-bottom: 1px solid var(--line); }
.outreach-feature h2 { display: flex; align-items: center; gap: 12px; font-size: 1.3rem; }
.photos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.photos img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-sm); }
/* Two columns that keep each card's natural height (order runs down the first column, then the second). */
.outreach-grid { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 16px; }
.o-card { break-inside: avoid; margin-bottom: 16px; display: grid; grid-template-columns: 42px minmax(0, 1fr); column-gap: 14px; align-content: start; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.o-card > :not(.o-icon) { grid-column: 2; }
.o-card .o-icon { grid-row: 1 / span 3; }
.o-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--tint); color: var(--brand-ink); font-size: 18px; flex: none; }
.o-card h3 { font-size: 1.06rem; margin: 6px 0 6px; }
.o-card p { font-size: .97rem; margin: 0; }
.o-card p + .link-chips { margin-top: 10px; }
@media (max-width: 760px) {
  .outreach-grid { columns: 1; }
}

/* ---- Contact --------------------------------------------------------------------------------- */

.notice { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--radius-sm); background: var(--tint-strong); color: var(--brand-ink); font-weight: 600; }
.contact-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 36px; }
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field > span { font-weight: 600; color: var(--ink); font-size: .95rem; }
.field input, .field textarea { width: 100%; font: 400 1rem/1.5 var(--font); color: var(--ink); padding: 11px 14px; border: 1px solid #cdd7d1; border-radius: 10px; background: #fbfcfb; transition: border-color .15s, box-shadow .15s; }
.field textarea { resize: vertical; min-height: 150px; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--brand-ink); background: #fff; box-shadow: 0 0 0 3px rgba(96, 198, 137, .35); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.hp { position: absolute; left: -9999px; }
.contact-aside { padding-left: 30px; border-left: 1px solid var(--line); }
.stack-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.stack-links a { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 600; }
.stack-links a:hover { background: var(--tint); }
.stack-links .i { width: 1.3em; color: var(--brand-ink); }
@media (max-width: 760px) {
  .contact-grid, .field-row { grid-template-columns: 1fr; }
  .contact-aside { padding: 22px 0 0; border-left: 0; border-top: 1px solid var(--line); }
}

.not-found { text-align: center; padding-top: 60px; padding-bottom: 60px; }
.not-found .lead { margin: 0 auto; }
.not-found .actions { justify-content: center; }

/* ---- Footer: readable on the doodles ---------------------------------------------------------- */

.site-footer { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 20px; text-align: center; }
.footer-links { list-style: none; margin: 0; padding: 5px; display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; background: rgba(255, 255, 255, .94); border-radius: 999px; box-shadow: var(--shadow); }
.footer-links a { display: inline-flex; align-items: center; gap: 7px; padding: 6px 13px; border-radius: 999px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: .9rem; }
.footer-links a:hover { background: var(--tint); }
.footer-links .i { color: var(--brand-ink); }
.site-footer p { margin: 0; padding: 2px 12px; border-radius: 999px; background: rgba(255, 255, 255, .9); color: var(--muted); font-size: .82rem; }
@media (max-width: 560px) { .footer-links { border-radius: 18px; } }
