/* light theme; the dark theme below replaces these values */
:root {
  color-scheme: light;
  --text: #1f2328;
  --muted: #59636e;
  --faint: #8b949e;
  --border: #e4e7eb;
  --border-strong: #c8ccd2;
  --bg: #ffffff;
  --card: #ffffff;
  --thumb: #f6f8fa;
  --accent: #0b66b8;
  --accent-hover: #5b5bd0;
  --nav-bg: rgba(255, 255, 255, 0.86);
  --shadow: rgba(31, 35, 40, 0.16);
  --shadow-soft: rgba(31, 35, 40, 0.08);
  /* the LoopSeek page's gradient: blue -> violet -> pink */
  --grad: linear-gradient(100deg, #0072b2 0%, #5b5bd0 50%, #b8448b 100%);
  --glow-1: rgba(0, 114, 178, 0.15);
  --glow-2: rgba(91, 91, 208, 0.14);
  --glow-3: rgba(184, 68, 139, 0.12);
  --chip-pre-bg: #e8f1fb; --chip-pre: #0b5ea8;
  --chip-rev-bg: #f8e8f1; --chip-rev: #9c3672;
  --chip-jour-bg: #e3f4ee; --chip-jour: #0b7a55;
  --chip-conf-bg: #ecebfb; --chip-conf: #4b48b8;
}

/* dark theme: the system setting unless the visitor picked light, or the visitor picked dark */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --text: #e6edf3;
    --muted: #a3adb8;
    --faint: #7d8590;
    --border: #2a3038;
    --border-strong: #444c56;
    --bg: #0d1117;
    --card: #121820;
    --thumb: #eef1f5;
    --accent: #5cadff;
    --accent-hover: #b8b0ff;
    --nav-bg: rgba(13, 17, 23, 0.82);
    --shadow: rgba(0, 0, 0, 0.55);
    --shadow-soft: rgba(0, 0, 0, 0.35);
    --grad: linear-gradient(100deg, #46a8ec 0%, #9a95ff 50%, #ef86c2 100%);
    --glow-1: rgba(70, 168, 236, 0.22);
    --glow-2: rgba(154, 149, 255, 0.19);
    --glow-3: rgba(239, 134, 194, 0.15);
    --chip-pre-bg: #0f2a45; --chip-pre: #8cc4ff;
    --chip-rev-bg: #3a1630; --chip-rev: #f3a6d0;
    --chip-jour-bg: #0c3124; --chip-jour: #74d9b1;
    --chip-conf-bg: #25244d; --chip-conf: #bcb8ff;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --text: #e6edf3;
  --muted: #a3adb8;
  --faint: #7d8590;
  --border: #2a3038;
  --border-strong: #444c56;
  --bg: #0d1117;
  --card: #121820;
  --thumb: #eef1f5;
  --accent: #5cadff;
  --accent-hover: #b8b0ff;
  --nav-bg: rgba(13, 17, 23, 0.82);
  --shadow: rgba(0, 0, 0, 0.55);
  --shadow-soft: rgba(0, 0, 0, 0.35);
  --grad: linear-gradient(100deg, #46a8ec 0%, #9a95ff 50%, #ef86c2 100%);
  --glow-1: rgba(70, 168, 236, 0.22);
  --glow-2: rgba(154, 149, 255, 0.19);
  --glow-3: rgba(239, 134, 194, 0.15);
  --chip-pre-bg: #0f2a45; --chip-pre: #8cc4ff;
  --chip-rev-bg: #3a1630; --chip-rev: #f3a6d0;
  --chip-jour-bg: #0c3124; --chip-jour: #74d9b1;
  --chip-conf-bg: #25244d; --chip-conf: #bcb8ff;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 Inter, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover, a:focus-visible { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 3px; }
.container { width: 100%; max-width: 980px; margin: 0 auto; padding: 0 20px; }

/* top bar */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: var(--nav-bg);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.brand { font-weight: 700; font-size: 1.05rem; color: var(--text); }
.nav-right { display: flex; align-items: center; gap: 20px; }
.nav-links { display: flex; gap: 22px; }
.nav-links a { color: var(--muted); font-weight: 500; font-size: 0.95rem; }
.nav-links a:hover { color: var(--text); text-decoration: none; }
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 0;
  border: 1px solid var(--border); border-radius: 999px; background: var(--card); color: var(--muted); cursor: pointer;
}
.theme-toggle:hover, .theme-toggle:focus-visible { color: var(--text); border-color: var(--border-strong); }
.theme-toggle svg { width: 17px; height: 17px; }

/* gradient text, with plain text where background-clip: text is missing */
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .brand {
    background-image: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
  }
  .brand:hover { text-decoration: none; }
}

/* about, on a faint glow of the gradient's colors */
.hero { position: relative; isolation: isolate; display: grid; grid-template-columns: 230px 1fr; gap: 44px; padding: 48px 0 8px; align-items: start; }
.hero::before {
  content: ""; position: absolute; z-index: -1; inset: -40px 0 -16px; pointer-events: none;
  background:
    radial-gradient(34% 58% at 14% 34%, var(--glow-1), transparent 72%),
    radial-gradient(32% 54% at 52% 14%, var(--glow-2), transparent 72%),
    radial-gradient(34% 58% at 90% 46%, var(--glow-3), transparent 72%);
  /* fade out toward every edge, so the glow never ends in a visible line */
  -webkit-mask-image: radial-gradient(closest-side at 50% 50%, #000 45%, transparent 100%);
  mask-image: radial-gradient(closest-side at 50% 50%, #000 45%, transparent 100%);
}
.avatar-ring { padding: 3px; border-radius: 21px; background: var(--grad); box-shadow: 0 10px 30px var(--shadow); }
.avatar { display: block; width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 18px; }
.quote { margin: 18px 4px 0; padding: 0; text-align: center; color: var(--muted); font-size: 0.92rem; font-style: italic; }
.quote p { margin: 0 0 4px; }
.quote footer { font-style: normal; font-size: 0.85rem; }
.head h1 { margin: 2px 0 6px; font-size: 2.5rem; line-height: 1.15; letter-spacing: -0.02em; font-weight: 700; }
.affil { margin: 0 0 18px; color: var(--muted); font-weight: 500; }
/* Virginia Tech in its own color: Chicago Maroon (brand.vt.edu); its fourth tint on dark backgrounds */
.affil a.vt, .affil a.vt:hover { color: #861f41; font-weight: 600; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .affil a.vt { color: #b6798d; } }
:root[data-theme="dark"] .affil a.vt { color: #b6798d; }
.intro p { margin: 0 0 12px; }
.buttons { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 8px; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--card);
  color: var(--text); font-weight: 500; font-size: 0.92rem;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.pill svg { width: 16px; height: 16px; flex: none; }
.pill:hover, .pill:focus-visible {
  color: var(--text); text-decoration: none; border-color: var(--border-strong);
  box-shadow: 0 4px 14px var(--shadow-soft); transform: translateY(-1px);
}
.intro .email { color: var(--faint); font-size: 0.9rem; margin: 6px 0 0; }

/* sections */
section { padding-top: 36px; }
h2 { position: relative; margin: 0 0 18px; padding-bottom: 8px; font-size: 1.55rem; letter-spacing: -0.01em; }
h2::after { content: ""; position: absolute; left: 0; bottom: 0; width: 48px; height: 3px; border-radius: 3px; background: var(--grad); }

/* publication and experience cards */
.note { margin: -8px 0 14px; color: var(--faint); font-size: 0.9rem; }
.card {
  display: grid; grid-template-columns: 220px 1fr; gap: 22px; padding: 18px; margin-bottom: 16px;
  border: 1px solid var(--border); border-radius: 14px; background: var(--card);
  transition: box-shadow 0.2s, border-color 0.2s;
}
.card:hover { border-color: var(--border-strong); box-shadow: 0 8px 26px var(--shadow-soft); }
.thumb { position: relative; display: flex; align-items: center; justify-content: center; aspect-ratio: 16 / 10; overflow: hidden; border-radius: 10px; background: var(--thumb); }
.thumb img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
/* a search replay that plays while the card is hovered: 13 frames of a 16:10 sprite, one 0.8 s step each */
.thumb .anim {
  position: absolute; inset: 0; opacity: 0; pointer-events: none;
  background-repeat: no-repeat; background-size: 100% 1300%; background-position: 0 0;
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .card:hover .anim-loopseek {
    opacity: 1;
    background-image: url("images/anim_loopseek.webp");
    animation: seek-replay 10.4s steps(13, jump-none) infinite;
  }
}
@keyframes seek-replay { from { background-position: 0 0%; } to { background-position: 0 100%; } }
.body .title { margin: 0 0 6px; font-weight: 600; font-size: 1.02rem; line-height: 1.45; }
.venue {
  display: inline-block; margin-right: 8px; padding: 1px 9px; border-radius: 6px;
  font-size: 0.76rem; font-weight: 600; letter-spacing: 0.01em; vertical-align: 2px;
}
.v-preprint { background: var(--chip-pre-bg); color: var(--chip-pre); }
.v-review { background: var(--chip-rev-bg); color: var(--chip-rev); }
.v-journal { background: var(--chip-jour-bg); color: var(--chip-jour); }
.v-conf { background: var(--chip-conf-bg); color: var(--chip-conf); }
.authors { margin: 0 0 6px; color: var(--muted); font-size: 0.94rem; }
.authors strong { color: var(--text); }
.authors a { color: var(--muted); text-decoration: underline dotted; text-underline-offset: 3px; }
.authors a:hover { color: var(--accent-hover); }
.where { margin: 0 0 6px; color: var(--muted); font-size: 0.94rem; font-style: italic; }
.links { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 0; }
.links a { padding: 3px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--card); color: var(--text); font-size: 0.84rem; font-weight: 500; }
.links a:hover, .links a:focus-visible { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.card.exp { grid-template-columns: 1fr; gap: 12px; }
.card .wide { display: block; width: 100%; max-width: 640px; height: auto; border-radius: 8px; background: var(--thumb); }

/* footer */
.site-footer { padding-top: 30px; padding-bottom: 40px; color: var(--faint); font-size: 0.85rem; }
.site-footer p { margin: 0; padding-top: 16px; border-top: 1px solid var(--border); }

/* small screens */
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; gap: 22px; padding-top: 28px; }
  .side { width: 100%; max-width: 220px; margin: 0 auto; }
  .head { text-align: center; }
  .head h1 { font-size: 2rem; }
  .buttons { justify-content: center; }
  .intro .email { text-align: center; }
  .card { grid-template-columns: 1fr; gap: 14px; padding: 14px; }
  .nav-right { gap: 14px; }
  .nav-links { gap: 14px; }
  .nav-links a { font-size: 0.88rem; }
}
@media (max-width: 440px) {
  .brand { display: none; }
  .nav { justify-content: center; }
}
@media (forced-colors: active) {
  .brand { background-image: none; color: CanvasText; -webkit-text-fill-color: CanvasText; }
}
