:root {
  --fg: #15140f;
  --fg-muted: #5a544a;
  --fg-faint: #8b8578;
  --bg: #faf7f1;
  --bg-alt: #f0ebe0;
  --accent: #b2422d;
  --accent-2: #d6823a;
  --accent-soft: rgba(178, 66, 45, 0.08);
  --rule: #e4ddce;
  --card: #ffffff;
  --card-border: #ece5d3;
  --shadow-sm: 0 1px 2px rgba(30, 20, 10, 0.04), 0 2px 8px rgba(30, 20, 10, 0.03);
  --shadow-md: 0 4px 16px rgba(30, 20, 10, 0.08), 0 12px 40px rgba(30, 20, 10, 0.06);
}

@media (prefers-color-scheme: dark) {
  :root {
    --fg: #ece7dc;
    --fg-muted: #a8a293;
    --fg-faint: #6f6a5d;
    --bg: #12110d;
    --bg-alt: #1c1a13;
    --accent: #e89465;
    --accent-2: #e8b573;
    --accent-soft: rgba(232, 148, 101, 0.1);
    --rule: #2a2720;
    --card: #1a1812;
    --card-border: #2c2820;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.5);
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

h1, h2, h3 {
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  color: var(--fg);
  line-height: 1.15;
  font-weight: 600;
}

p { margin: 0 0 1rem; }

/* HERO */
.hero {
  position: relative;
  background:
    radial-gradient(ellipse at 85% 15%, var(--accent-soft) 0%, transparent 55%),
    linear-gradient(180deg, var(--bg-alt) 0%, var(--bg) 100%);
  padding: 4.5rem 1.5rem 3rem;
  overflow: hidden;
  border-bottom: 1px solid var(--rule);
}
.hero::before {
  content: "";
  position: absolute;
  top: -80px;
  left: -80px;
  width: 260px;
  height: 260px;
  background: var(--accent);
  opacity: 0.06;
  border-radius: 50%;
  filter: blur(40px);
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute;
  bottom: -120px;
  right: -60px;
  width: 320px;
  height: 320px;
  background: var(--accent-2);
  opacity: 0.07;
  border-radius: 50%;
  filter: blur(50px);
  pointer-events: none;
}
.hero-inner {
  position: relative;
  max-width: 1000px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3rem;
  align-items: center;
}
.hero-text { min-width: 0; }
.eyebrow {
  display: inline-block;
  margin: 0 0 1rem;
  padding: 0.3rem 0.8rem;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 999px;
  border: 1px solid var(--accent);
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
}
.hero h1 {
  font-size: clamp(2.75rem, 6vw, 4.5rem);
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.tagline {
  font-size: 1.15rem;
  color: var(--fg-muted);
  max-width: 42rem;
  margin: 0 0 1.5rem;
  line-height: 1.55;
}
.badges { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 1.75rem; }
.badge {
  font-size: 0.82rem;
  padding: 0.4rem 0.85rem;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 6px;
  color: var(--fg);
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}
.links-inline { display: flex; flex-wrap: wrap; gap: 1.3rem; font-size: 0.95rem; }
.links-inline a {
  color: var(--fg-muted);
  font-weight: 500;
}
.links-inline a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.hero-portrait img {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--card);
  box-shadow: var(--shadow-md);
}

@media (max-width: 720px) {
  .hero { padding: 3rem 1.25rem 2rem; }
  .hero-inner { grid-template-columns: 1fr; gap: 1.5rem; }
  .hero-portrait { order: -1; }
  .hero-portrait img { width: 120px; height: 120px; }
  .tagline { font-size: 1.05rem; }
}

/* MAIN */
main {
  max-width: 860px;
  margin: 0 auto;
  padding: 3.5rem 1.5rem 4rem;
}
section { margin-bottom: 4rem; }
section:last-of-type { margin-bottom: 2.5rem; }

h2 {
  font-size: 1.75rem;
  margin: 0 0 1.5rem;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid var(--fg);
  display: inline-block;
}
h3 { font-size: 1.35rem; margin: 0.15rem 0 0.6rem; }

#about p { font-size: 1.05rem; color: var(--fg-muted); max-width: 42rem; }

/* PROJECT CARDS */
.project {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  overflow: hidden;
  margin: 0 0 2rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.project:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.project-body { padding: 1.5rem 1.75rem 1.75rem; }
.project .meta {
  color: var(--fg-faint);
  font-size: 0.78rem;
  margin: 0 0 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}
.project p { color: var(--fg-muted); }
.project .refs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.88rem;
  margin: 1rem 0 0;
}
.project .refs a {
  padding: 0.35rem 0.8rem;
  background: var(--bg-alt);
  border: 1px solid var(--card-border);
  border-radius: 6px;
  color: var(--fg);
  transition: background 0.15s ease, border-color 0.15s ease;
}
.project .refs a:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* VIDEO THUMB */
.video-thumb {
  display: block;
  position: relative;
  overflow: hidden;
  border: none;
  line-height: 0;
  aspect-ratio: 16 / 9;
  background: #000;
}
.video-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease, filter 0.2s ease;
}
.video-thumb:hover { border-bottom: none; }
.video-thumb:hover img { transform: scale(1.03); filter: brightness(0.85); }
.video-thumb .play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
  padding-left: 7px;
  pointer-events: none;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s ease;
}
.video-thumb:hover .play {
  transform: translate(-50%, -50%) scale(1.08);
}

/* COMPACT LISTS (press, publications, patents, repos) */
.list { list-style: none; padding: 0; margin: 0; }
.list li {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 1rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--rule);
  font-size: 0.95rem;
  line-height: 1.5;
}
.list li:last-child { border-bottom: none; }
.list .date {
  color: var(--fg-faint);
  font-variant-numeric: tabular-nums;
  font-size: 0.82rem;
  padding-top: 0.15rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.list .body { min-width: 0; }
.list .body strong { color: var(--fg); font-weight: 600; }
.list .outlet {
  display: inline-block;
  color: var(--fg);
  font-weight: 600;
  margin-right: 0.5rem;
}
.list .outlet::after {
  content: "·";
  margin-left: 0.5rem;
  color: var(--fg-faint);
  font-weight: 400;
}
.list .authors { color: var(--fg-muted); }
.list .venue { color: var(--fg-faint); font-style: italic; }

@media (max-width: 560px) {
  .list li { grid-template-columns: 1fr; gap: 0.2rem; }
  .list .date { font-size: 0.78rem; }
}

.more { margin-top: 1rem; font-size: 0.95rem; }

/* FOOTER */
footer {
  text-align: center;
  padding: 2rem 1.5rem 3rem;
  border-top: 1px solid var(--rule);
  background: var(--bg-alt);
  color: var(--fg-faint);
  font-size: 0.9rem;
}
footer p { margin: 0.25rem 0; }
footer a { color: var(--fg); font-weight: 500; }
footer .copy { font-size: 0.82rem; margin-top: 0.5rem; }
