:root {
  --bg: #f5f4ef;
  --paper: #fbfaf6;
  --ink: #171815;
  --muted: #6f716b;
  --line: #d9d7cf;
  --line-dark: #bdbbb2;
  --accent: #335f54;
  --accent-soft: #e6ece8;
  --max: 1180px;
  --serif: "Source Serif 4", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
button, input, textarea { font: inherit; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px max(24px, calc((100vw - var(--max)) / 2));
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 75%, transparent);
}

.brand {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  text-decoration: none;
  font-family: var(--serif);
  font-weight: 600;
}

nav { display: flex; gap: 24px; }
nav a { text-decoration: none; color: var(--muted); font-size: 14px; }
nav a:hover { color: var(--ink); }

.section-shell {
  width: min(var(--max), calc(100% - 48px));
  margin: 0 auto;
}

.hero {
  padding: 110px 0 70px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin-bottom: 16px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1, h2, h3 { margin: 0; }
h1, h2 { font-family: var(--serif); font-weight: 600; letter-spacing: -0.025em; }
h1 { max-width: 900px; font-size: clamp(48px, 7vw, 82px); line-height: 0.99; }
h2 { font-size: clamp(34px, 4vw, 52px); line-height: 1.04; }
h3 { font-size: 20px; letter-spacing: -0.015em; }

.hero-copy {
  max-width: 830px;
  margin: 30px 0 0;
  color: #42443f;
  font-size: 20px;
  line-height: 1.65;
}

.hero-actions { display: flex; gap: 10px; margin-top: 30px; }
.button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--line-dark);
  border-radius: 999px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  background: var(--paper);
}
.button.primary { background: var(--ink); color: white; border-color: var(--ink); }
.button:hover { transform: translateY(-1px); }

.hero-meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
  margin-top: 72px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}
.hero-meta strong { display: block; margin-bottom: 3px; color: var(--ink); font-size: 15px; }

.section-block { padding: 86px 0; border-bottom: 1px solid var(--line); }
.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr);
  gap: 60px;
  align-items: end;
  margin-bottom: 40px;
}
.section-heading > p { margin: 0; color: var(--muted); max-width: 430px; }

.project-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.project-card {
  position: relative;
  min-height: 300px;
  padding: 26px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  display: flex;
  flex-direction: column;
}
.project-card.featured { min-height: 355px; }
.project-card:hover { border-color: var(--line-dark); }
.project-kicker { color: var(--accent); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.project-card h3 { margin-top: 12px; font-family: var(--serif); font-size: 30px; }
.project-card p { margin: 16px 0 0; max-width: 620px; color: #454741; }
.project-note { margin-top: 14px; color: var(--muted); font-size: 13px; }
.card-actions { display: flex; align-items: center; gap: 12px; margin-top: auto; padding-top: 28px; flex-wrap: wrap; }
.card-actions.multi { gap: 10px 14px; }
.text-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 1px solid var(--line-dark);
}
.text-button:hover { border-color: var(--ink); }

.research-list { border-top: 1px solid var(--line-dark); }
.research-item {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 22px;
  padding: 30px 0 34px;
  border-bottom: 1px solid var(--line);
}
.research-number { color: var(--muted); font-size: 12px; padding-top: 5px; }
.research-item h3 { font-family: var(--serif); font-size: 28px; }
.research-item p { margin: 10px 0 0; max-width: 850px; color: #494b46; }
.tags { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 16px; }
.tags span { padding: 5px 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 11px; background: var(--paper); }

.two-column-section { display: grid; grid-template-columns: 320px 1fr; gap: 70px; }
.publication-list { border-top: 1px solid var(--line-dark); }
.publication {
  display: grid;
  grid-template-columns: 66px 1fr;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: #3d3f3a;
}
a.publication:hover strong { text-decoration: underline; text-underline-offset: 3px; }
.publication .year { color: var(--muted); font-size: 12px; padding-top: 4px; }
.publication strong { color: var(--ink); font-weight: 600; }

.talk-grid { display: grid; grid-template-columns: repeat(2, 1fr); border-top: 1px solid var(--line-dark); }
.talk { padding: 20px 18px 20px 0; border-bottom: 1px solid var(--line); }
.talk:nth-child(odd) { border-right: 1px solid var(--line); padding-right: 24px; }
.talk:nth-child(even) { padding-left: 24px; }
.talk strong, .talk span { display: block; }
.talk span { margin-top: 3px; color: var(--muted); font-size: 13px; }

.timeline { border-top: 1px solid var(--line-dark); }
.timeline-item { display: grid; grid-template-columns: 150px 1fr; gap: 30px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.timeline-year { color: var(--muted); font-size: 13px; }
.timeline-item p { margin: 5px 0 0; color: #50524c; }

.capability-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 36px; }
.capability-grid > div { padding: 22px; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; }
.capability-grid h3 { font-family: var(--serif); font-size: 22px; }
.capability-grid p { margin: 8px 0 0; color: var(--muted); font-size: 13px; }

.contact-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  padding: 86px 0 100px;
}
.contact-links { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding-top: 8px; }
.contact-links a { text-decoration: none; border-bottom: 1px solid var(--line-dark); }
.contact-links a:hover { border-color: var(--ink); }

.site-footer {
  display: flex;
  justify-content: space-between;
  padding-top: 24px;
  padding-bottom: 34px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.preview-dialog {
  width: min(1320px, calc(100vw - 32px));
  height: min(900px, calc(100vh - 32px));
  padding: 0;
  border: 1px solid var(--line-dark);
  border-radius: 16px;
  background: var(--paper);
  box-shadow: 0 28px 90px rgba(0,0,0,.25);
  overflow: hidden;
}
.preview-dialog::backdrop { background: rgba(19,20,18,.45); backdrop-filter: blur(4px); }
.preview-topbar { display: flex; justify-content: space-between; align-items: center; min-height: 62px; padding: 10px 14px 10px 18px; border-bottom: 1px solid var(--line); }
.preview-label { display: block; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .11em; }
.preview-topbar strong { display: block; margin-top: 1px; }
.preview-actions { display: flex; align-items: center; gap: 12px; }
.preview-actions a { font-size: 12px; text-decoration: none; border-bottom: 1px solid var(--line-dark); }
.preview-actions button { border: 1px solid var(--line-dark); background: transparent; border-radius: 999px; padding: 7px 12px; cursor: pointer; }
.preview-frame-wrap { position: relative; height: calc(100% - 62px); background: white; }
.preview-frame-wrap iframe { position: relative; z-index: 2; display: block; width: 100%; height: 100%; border: 0; background: white; }
.preview-fallback { position: absolute; inset: 0; display: grid; place-items: center; padding: 30px; color: var(--muted); text-align: center; font-size: 13px; }

@media (max-width: 860px) {
  nav { gap: 14px; }
  nav a:nth-child(3), nav a:nth-child(4) { display: none; }
  .hero { padding-top: 80px; }
  .hero-meta { grid-template-columns: repeat(2, 1fr); }
  .section-heading, .two-column-section, .contact-section { grid-template-columns: 1fr; gap: 28px; }
  .project-grid, .capability-grid { grid-template-columns: 1fr; }
  .talk-grid { grid-template-columns: 1fr; }
  .talk:nth-child(odd) { border-right: 0; padding-right: 0; }
  .talk:nth-child(even) { padding-left: 0; }
  .timeline-item { grid-template-columns: 1fr; gap: 4px; }
}

@media (max-width: 560px) {
  .section-shell { width: min(var(--max), calc(100% - 30px)); }
  .site-header { padding: 14px 15px; }
  nav { gap: 12px; }
  nav a { font-size: 12px; }
  h1 { font-size: 46px; }
  .hero-copy { font-size: 17px; }
  .hero-meta { grid-template-columns: 1fr; gap: 14px; margin-top: 50px; }
  .section-block { padding: 66px 0; }
  .research-item { grid-template-columns: 40px 1fr; gap: 8px; }
  .publication { grid-template-columns: 48px 1fr; }
  .preview-dialog { width: calc(100vw - 12px); height: calc(100vh - 12px); }
  .preview-topbar { min-height: 72px; }
  .preview-frame-wrap { height: calc(100% - 72px); }
}
