@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=DM+Sans:wght@400;500;600;700&display=swap');

:root {
  color-scheme: light;
  --bg: #f7f6f2;
  --surface: #fdfcf9;
  --ink: #1d2420;
  --muted: #6a736c;
  --line: #e2e1da;
  --accent: #47796a;
  --accent-ink: #315d50;
  --mono: 'DM Mono', 'Courier New', monospace;
  --sans: 'DM Sans', system-ui, Arial, sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #171b18;
  --surface: #1f2421;
  --ink: #e8ebe5;
  --muted: #98a29a;
  --line: #2c332e;
  --accent: #8abaa6;
  --accent-ink: #a5cbb7;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
::selection { background: var(--accent); color: var(--bg); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.wrap { width: min(880px, calc(100% - 48px)); margin-inline: auto; }

.skip-link { position: absolute; z-index: 60; top: 8px; left: 8px; padding: 10px 14px; transform: translateY(-160%); background: var(--ink); color: var(--bg); }
.skip-link:focus { transform: translateY(0); }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 40; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); }
.header-inner { display: flex; align-items: center; height: 64px; gap: 18px; }
.wordmark { font-weight: 700; font-size: 14px; letter-spacing: -.02em; }
.menu-toggle { display: none; }
.nav { display: flex; align-items: center; gap: 20px; margin-left: auto; }
.nav > a { font-size: 13px; color: var(--muted); transition: color .18s; }
.nav > a:hover, .nav > a[aria-current="location"] { color: var(--accent-ink); }
.theme-toggle { width: 32px; height: 32px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: none; cursor: pointer; }
.theme-toggle svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.i-moon { display: none; }
:root[data-theme="dark"] .i-sun { display: none; }
:root[data-theme="dark"] .i-moon { display: block; }

/* ---------- hero ---------- */
.hero { display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center; padding-block: 88px 96px; }
.kicker { margin: 0 0 18px; color: var(--accent-ink); font: 500 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; }
h1 { margin: 0 0 18px; font-size: clamp(40px, 6.5vw, 58px); font-weight: 700; line-height: 1.02; letter-spacing: -.045em; }
.hero-intro { max-width: 44ch; margin: 0 0 26px; color: var(--muted); font-size: 16px; line-height: 1.65; }
.hero-links { display: flex; flex-wrap: wrap; gap: 18px; margin-bottom: 30px; }
.hero-links a { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font: 500 12px var(--mono); letter-spacing: .04em; border-bottom: 1px solid var(--line); padding-bottom: 2px; transition: color .18s, border-color .18s; }
.hero-links a svg { width: 10px; height: 10px; flex: none; fill: currentColor; opacity: .75; }
.hero-links a:hover { color: var(--accent-ink); border-color: var(--accent); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-photo { margin: 0; }
.hero-photo img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; object-position: 50% 28%; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; min-height: 42px; padding: 0 16px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; font-weight: 600; transition: border-color .18s, color .18s, transform .18s; }
.btn:hover { transform: translateY(-1px); border-color: var(--accent); color: var(--accent-ink); }
.btn-solid { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn-solid:hover { color: var(--bg); border-color: var(--accent-ink); background: var(--accent-ink); }

/* ---------- sections ---------- */
.section { padding-block: 78px; border-top: 1px solid var(--line); }
.section-last { padding-bottom: 96px; }
.sec-head { display: flex; align-items: baseline; gap: 16px; margin-bottom: 44px; }
.sec-head span { color: var(--accent); font: 500 12px var(--mono); }
.sec-head h2 { margin: 0; font-size: clamp(24px, 3.4vw, 32px); font-weight: 700; letter-spacing: -.035em; }
.sec-side { margin-left: auto; color: var(--muted); font: 500 11px var(--mono); letter-spacing: .04em; transition: color .18s; }
.sec-side:hover { color: var(--accent-ink); }

/* about */
.about-grid { display: grid; grid-template-columns: 1fr; gap: 28px; align-items: start; }
.about-text p { margin: 0 0 16px; color: var(--muted); font-size: 14.5px; line-height: 1.75; }
.about-text p:first-child { color: var(--ink); font-size: 16px; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 0 40px; margin: 44px 0 0; }
.facts > div { display: grid; grid-template-columns: 64px 1fr; gap: 14px; padding: 13px 0; border-top: 1px solid var(--line); }
.facts dt { color: var(--accent-ink); font: 500 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.facts dd { margin: 0; font-size: 13px; color: var(--ink); }

/* strict row lists (research / pubs / experience) */
.pub-kind { margin: 0 0 6px; color: var(--accent-ink); font: 500 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.pub-group + .pub-group .pub-kind { margin-top: 34px; }
.pub-group { margin-bottom: 8px; }
.rows { border-top: 1px solid var(--line); }
.row { padding: 20px 0; border-bottom: 1px solid var(--line); }
.row-def { display: grid; grid-template-columns: 200px 1fr; gap: 22px; }
.row-def h3 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.row-def p { margin: 2px 0 0; color: var(--muted); font-size: 13.5px; line-height: 1.6; }

.row-pub { display: grid; grid-template-columns: 56px 1fr; gap: 18px; transition: background .15s; }
.row-pub:hover { background: color-mix(in srgb, var(--surface) 70%, transparent); }
.year { padding-top: 3px; color: var(--muted); font: 500 12px var(--mono); }
.row-pub h3 { margin: 0; font-size: 14.5px; font-weight: 600; line-height: 1.45; letter-spacing: -.01em; }
.row-pub h3 a:hover { color: var(--accent-ink); }
.row-pub h3 p, .row-pub .venue { margin: 4px 0 0; }
.row-pub p { margin: 4px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.55; }
.row-pub p a { color: var(--accent-ink); font: 500 11px var(--mono); border-bottom: 1px solid var(--line); }
.row-pub p a:hover { border-color: var(--accent); }

/* paper videos */
.video-embed { position: relative; max-width: 520px; margin: 14px 0 4px; aspect-ratio: 16 / 9; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--ink); }
.video-embed--short { max-width: 300px; aspect-ratio: 9 / 16; }
.video-play { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: pointer; }
.video-play img { width: 100%; height: 100%; object-fit: cover; opacity: .85; transition: opacity .18s, transform .3s ease; }
.video-play:hover img, .video-play:focus-visible img { opacity: 1; transform: scale(1.03); }
.video-badge { position: absolute; top: 50%; left: 50%; translate: -50% -50%; display: grid; place-items: center; width: 58px; height: 40px; border-radius: 12px; background: #f00; box-shadow: 0 6px 18px rgb(0 0 0 / .35); }
.video-play:hover .video-badge, .video-play:focus-visible .video-badge { background: #d90d0d; }
.video-badge svg { width: 22px; height: 22px; fill: #fff; }
.video-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.row-exp { display: grid; grid-template-columns: 92px 1fr; gap: 18px; }
.when { padding-top: 3px; color: var(--muted); font: 500 12px var(--mono); }
.row-exp h3 { margin: 0; font-size: 14.5px; font-weight: 600; letter-spacing: -.01em; }
.row-exp h3 a { color: var(--accent-ink); font-weight: 500; }
.row-exp p { margin: 4px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.workshops { margin: 26px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.7; }
.workshops strong { color: var(--ink); font-weight: 600; }

/* cv + contact */
.cv-links { display: flex; flex-wrap: wrap; gap: 12px; }
.email a { font: 500 clamp(18px, 3vw, 24px)/1.3 var(--mono); border-bottom: 2px solid var(--accent); padding-bottom: 3px; transition: color .18s; }
.email a:hover { color: var(--accent-ink); }

/* footer */
.site-footer { border-top: 1px solid var(--line); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; height: 60px; color: var(--muted); font-size: 12px; }
.footer-inner a { font: 500 11px var(--mono); }
.footer-inner a:hover { color: var(--accent-ink); }

/* reveal */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity .4s ease, transform .4s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  .wrap { width: calc(100% - 40px); }
  .menu-toggle { width: 40px; height: 40px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; margin-left: auto; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: none; cursor: pointer; }
  .menu-toggle span { width: 15px; height: 1.5px; background: var(--ink); transition: transform .18s; }
  .menu-toggle[aria-expanded="true"] span:first-child { transform: translateY(3.2px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] span:last-child { transform: translateY(-3.2px) rotate(-45deg); }
  .nav { position: absolute; top: 64px; left: 0; right: 0; display: none; flex-direction: column; align-items: stretch; gap: 0; padding: 6px 20px 16px; border-bottom: 1px solid var(--line); background: var(--bg); }
  .nav.is-open { display: flex; }
  .nav > a { min-height: 44px; display: flex; align-items: center; border-bottom: 1px solid var(--line); font-size: 14px; color: var(--ink); }
  .nav > a:last-of-type { border-bottom: 0; }
  .theme-toggle { margin-top: 14px; }
  .hero { grid-template-columns: 1fr; gap: 36px; padding-block: 56px 64px; }
  .hero-photo { order: -1; max-width: 320px; }
  .hero-photo img { aspect-ratio: 1 / 1; }
  .about-grid { grid-template-columns: 1fr; gap: 28px; }
  .facts { grid-template-columns: 1fr; margin-top: 32px; }
  .row-def { grid-template-columns: 1fr; gap: 4px; }
  .row-pub { grid-template-columns: 1fr; gap: 4px; }
  .row-exp { grid-template-columns: 1fr; gap: 4px; }
  .section { padding-block: 58px; }
  .sec-head { margin-bottom: 30px; }
}

@media (max-width: 400px) {
  .wrap { width: calc(100% - 32px); }
  h1 { font-size: 38px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation: none !important; }
  .reveal { opacity: 1; transform: none; }
}
