:root {
  --accent: #a64955;
  --black: #111;
  --grey: #555;
  --line: #e6e6e6;
  --soft: #f4f4f2;
  --bg: #fff;
  --max: 1120px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  color: var(--black);
  background: var(--bg);
}
img { max-width: 100%; display: block; }
a { color: inherit; }
p a, li a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
p a:hover, li a:hover { color: var(--black); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px; gap: 16px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 19px; letter-spacing: -.02em;
  text-decoration: none; white-space: nowrap;
}
.brand img { width: 26px; height: auto; }
.nav { display: flex; align-items: center; gap: 26px; }
.nav a { font-size: 15px; font-weight: 600; text-decoration: none; }
.nav a:not(.btn):hover { color: var(--accent); }

.lang { display: flex; gap: 2px; margin-left: 4px; }
.lang button {
  font: inherit; font-size: 12.5px; font-weight: 700; letter-spacing: .04em;
  background: none; border: 0; padding: 4px 6px; cursor: pointer; color: #999;
}
.lang button:hover { color: var(--black); }
.lang button[aria-pressed="true"] { color: var(--accent); }

.btn {
  display: inline-block;
  background: var(--accent); color: #fff !important;
  font-weight: 700; font-size: 15px;
  padding: 10px 22px; border-radius: 6px;
  text-decoration: none !important; border: 0; cursor: pointer; font-family: inherit;
  transition: background .15s;
}
.btn:hover { background: var(--black); }
.btn-ghost {
  background: none; color: var(--black) !important;
  border: 1.5px solid var(--black); padding: 9px 20px;
}
.btn-ghost:hover { background: var(--black); color: #fff !important; }

.menu-toggle { display: none; background: none; border: 0; padding: 8px; cursor: pointer; }
.menu-toggle span { display: block; width: 24px; height: 2px; background: var(--black); margin: 5px 0; }

/* ---------- Hero: text on the left, photo flush to the top and right edge ---------- */
.hero {
  display: grid; grid-template-columns: 1fr 1fr; align-items: stretch;
  --edge: max(24px, calc((100vw - var(--max)) / 2 + 24px));
}
.hero-text { padding: 64px 56px 40px var(--edge); align-self: center; }
.hero h1 {
  font-size: clamp(42px, 5.6vw, 68px);
  line-height: 1.02; letter-spacing: -.035em;
  font-weight: 800; color: var(--accent);
  margin: 0 0 24px;
}
.tagline {
  font-size: clamp(14px, 1.45vw, 17px); font-weight: 700; line-height: 1.4; margin: 0 0 24px;
  white-space: nowrap;
}
.tagline i { font-style: normal; color: var(--accent); margin: 0 .3em; }
.bio { font-size: 15.5px; line-height: 1.6; color: var(--grey); margin: 0; max-width: 520px; }
.bio strong { color: var(--black); }
.hero-photo { margin: 0; }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 78% 30%; }

/* ---------- Sections ---------- */
.section { padding: 56px 0; scroll-margin-top: 72px; }
.section.soft { background: var(--soft); }
.section h2 {
  font-size: clamp(28px, 3.4vw, 38px); line-height: 1.12; letter-spacing: -.025em; margin: 0 0 32px;
}

/* Research: 2 × 2 cards */
.projects { display: grid; grid-template-columns: 1fr 1fr; gap: 40px 48px; }
.project img {
  width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 4px; margin-bottom: 18px;
}
.project h3 { font-size: 22px; line-height: 1.2; letter-spacing: -.015em; margin: 0 0 10px; }
.project p { margin: 0; font-size: 16px; color: #333; }

/* ---------- Lists (publications, CV) ---------- */
.list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.list li {
  display: grid; grid-template-columns: 150px 1fr; gap: 24px;
  padding: 16px 0; border-bottom: 1px solid var(--line); font-size: 16px;
}
.list .year { font-weight: 800; color: var(--accent); font-size: 15px; }
.list a { word-break: break-word; }
.list .award { display: inline-block; font-size: 13px; font-weight: 700; color: var(--accent); }
.js .list li.extra { display: none; }
.js .list.open li.extra { display: grid; }
.more-row { margin-top: 24px; }
.no-js-hide { display: none; }
.js .no-js-hide { display: inline-block; }

/* CV tabs */
.tabs { display: flex; gap: 28px; border-bottom: 1px solid var(--line); margin-bottom: 8px; flex-wrap: wrap; }
.tab {
  font: inherit; font-weight: 800; font-size: 18px; color: #999; background: none; cursor: pointer;
  border: 0; border-bottom: 3px solid transparent; padding: 0 0 12px; margin-bottom: -1px;
}
.tab:hover { color: var(--black); }
.tab[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.panel { padding-top: 8px; }
.panel-title { font-size: 22px; margin: 32px 0 12px; }
.js .panel-title { display: none; }
.panel .list { border-top: 0; }
.group-title {
  font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--grey); margin: 28px 0 4px;
}
.note { color: var(--grey); font-size: 15px; margin: 20px 0 0; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 40px 0; font-size: 15px; }
.site-footer .wrap { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }
.site-footer nav { display: flex; gap: 22px; flex-wrap: wrap; }
.site-footer a { text-decoration: none; font-weight: 600; }
.site-footer a:hover { color: var(--accent); }
.copy { color: var(--grey); margin: 0; font-size: 14px; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .nav { gap: 18px; }
}
@media (max-width: 860px) {
  .hero, .projects { grid-template-columns: 1fr; }
  .hero-photo { order: -1; }
  .hero-photo img { height: auto; aspect-ratio: 4 / 3; }
  .hero-text { padding: 36px 24px 8px; }
  .tagline { white-space: normal; }
  .projects { gap: 40px; }
  .list li { grid-template-columns: 1fr; gap: 2px; }
  .section { padding: 44px 0; }
}
@media (max-width: 780px) {
  .wrap { padding: 0 16px; }
  .hero-text { padding: 32px 16px 8px; }
  .menu-toggle { display: block; }
  .nav {
    display: none; position: absolute; top: 72px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: #fff; border-bottom: 1px solid var(--line); padding: 8px 16px 20px;
  }
  .nav.open { display: flex; }
  .nav a { padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 17px; }
  .nav .btn { margin-top: 16px; text-align: center; border: 0; padding: 12px; }
  .lang { margin: 14px 0 0; justify-content: center; }
  .lang button { font-size: 15px; padding: 6px 12px; }
}
