@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;0,900;1,400;1,700&family=IBM+Plex+Mono:wght@300;400&family=IBM+Plex+Sans:wght@300;400;500&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #f7f4ec;
  --bg2:       #eeebe0;
  --surface:   #e5e2d8;
  --blue:      #1a4020;
  --blue-mid:  #2e6632;
  --blue-lt:   #3d8042;
  --blue-glow: #2e6632;
  --white:     #1a1a17;
  --off-white: #5c5c56;
  --muted:     #8a8a84;
  --border:    rgba(26,26,23,0.10);
  --border-b:  rgba(26,26,23,0.18);
  --accent:    #2e6632;
  --nav-h:     60px;
  --max-w:     900px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 300;
  font-size: 15.5px;
  line-height: 1.75;
  color: var(--white);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body::before {
  content: '';
  display: block;
  height: 3px;
  background: linear-gradient(90deg, var(--blue) 0%, var(--blue-glow) 50%, var(--blue) 100%);
}

/* Nav */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(247,244,236,0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  height: var(--nav-h);
  display: flex;
  align-items: center;
}

.nav-inner {
  max-width: var(--max-w);
  width: 100%;
  margin: 0 auto;
  padding: 0 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--white);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 2.2rem;
}

.nav-links a {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: color 0.2s;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--blue-glow);
  transition: width 0.25s;
}

.nav-links a:hover,
.nav-links a.active { color: var(--white); }

.nav-links a:hover::after,
.nav-links a.active::after { width: 100%; }

/* Main */
main {
  flex: 1;
  max-width: var(--max-w);
  width: 100%;
  margin: 0 auto;
  padding: 4rem 2.5rem 6rem;
}

/* Home hero */
.home-hero {
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 4rem;
  align-items: start;
  padding-bottom: 3.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 3.5rem;
}

.home-hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: 3.4rem;
  font-weight: 900;
  line-height: 1.05;
  margin-bottom: 0.6rem;
  letter-spacing: -0.02em;
  color: var(--white);
}

.home-hero .subtitle {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.74rem;
  color: var(--blue-glow);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 2rem;
}

.home-hero p {
  font-size: 0.96rem;
  color: var(--off-white);
  margin-bottom: 1.2rem;
  line-height: 1.8;
}

.photo-placeholder {
  width: 200px;
  height: 200px;
  border: 1px solid var(--border-b);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.65rem;
  text-align: center;
  line-height: 1.6;
  flex-shrink: 0;
  position: relative;
}

.photo-placeholder::after {
  content: '';
  position: absolute;
  top: 7px; left: 7px;
  right: -7px; bottom: -7px;
  border: 1px solid var(--blue);
  pointer-events: none;
}

.home-photo {
  width: 200px;
  height: 200px;
  object-fit: cover;
  border: 1px solid var(--border-b);
  flex-shrink: 0;
}

.cv-link {
  display: inline-block;
  margin-top: 0.5rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue-glow);
  text-decoration: none;
  border-bottom: 1px solid rgba(46,102,50,0.35);
  padding-bottom: 2px;
  transition: border-color 0.2s, color 0.2s;
}
.cv-link:hover { color: var(--white); border-color: var(--white); }

/* Social links */
.social-links {
  display: flex;
  gap: 0.6rem;
  margin-top: 1.8rem;
  flex-wrap: wrap;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.67rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--off-white);
  text-decoration: none;
  border: 1px solid var(--border-b);
  padding: 0.35rem 0.85rem;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.social-links a:hover {
  background: var(--blue);
  border-color: var(--blue-mid);
  color: var(--white);
}

.social-links svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  fill: currentColor;
}

/* Funding */
.funding { margin-top: 2.5rem; }

.funding h3 {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1rem;
}

.funding-grid { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.funding-tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 0.22rem 0.65rem;
}

/* Page headings */
h2.page-title {
  font-family: 'Playfair Display', serif;
  font-size: 2.8rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--white);
  margin-bottom: 0.4rem;
  line-height: 1.1;
}

.page-subtitle {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 3rem;
  text-transform: uppercase;
}

.page-subtitle a {
  color: var(--blue-glow);
  text-decoration: none;
  border-bottom: 1px solid rgba(46,102,50,0.3);
}
.page-subtitle a:hover { color: var(--white); }

/* Papers */
.papers-list { list-style: none; }

.paper-item {
  padding: 1.8rem 0;
  border-bottom: 1px solid var(--border);
}

.paper-item:first-child { border-top: 1px solid var(--border); }

.paper-year {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  color: var(--blue-glow);
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}

.paper-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.18rem;
  font-weight: 700;
  font-style: normal;
  line-height: 1.3;
  margin-bottom: 0.4rem;
}

.paper-title a {
  color: var(--white);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.paper-title a:hover { border-color: var(--blue-mid); }

.paper-authors {
  font-size: 0.84rem;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.paper-authors strong { color: var(--off-white); font-weight: 500; }

.paper-journal {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.73rem;
  color: var(--muted);
}

.paper-links { display: flex; gap: 0.5rem; margin-top: 0.75rem; }

.paper-links a {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.63rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue-glow);
  text-decoration: none;
  border: 1px solid rgba(46,102,50,0.35);
  padding: 0.2rem 0.6rem;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.paper-links a:hover { background: var(--blue); color: var(--white); border-color: var(--blue-mid); }

/* Coauthorship */
.coauthors-section { margin-top: 4rem; }

.coauthors-section h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 0.3rem;
}

.coauthor-list { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }

.coauthor-tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 0.25rem 0.75rem;
  text-decoration: none;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.coauthor-tag:hover { color: var(--white); border-color: var(--blue-mid); background: var(--blue); }

/* Tools */
.tools-list { list-style: none; }

.tool-item {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 2.5rem;
  padding: 2.2rem 0;
  border-bottom: 1px solid var(--border);
  align-items: start;
}

.tool-item:first-child { border-top: 1px solid var(--border); }

.tool-logo-wrap {
  width: 100px;
  height: 100px;
  border: 1px solid var(--border-b);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.6rem;
  text-align: center;
  line-height: 1.5;
}

.tool-logo-wrap img { width: 100%; height: 100%; object-fit: contain; }

.tool-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 0.15rem;
}

.tool-name a { color: inherit; text-decoration: none; transition: color 0.2s; }
.tool-name a:hover { color: var(--blue-glow); }

.tool-tagline {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.07em;
  color: var(--blue-glow);
  text-transform: uppercase;
  margin-bottom: 0.8rem;
}

.tool-desc {
  font-size: 0.92rem;
  color: var(--off-white);
  line-height: 1.75;
  margin-bottom: 0.9rem;
}

.tool-links { display: flex; gap: 0.5rem; }

.tool-links a {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.63rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue-glow);
  text-decoration: none;
  border: 1px solid rgba(46,102,50,0.35);
  padding: 0.2rem 0.6rem;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.tool-links a:hover { background: var(--blue); color: var(--white); border-color: var(--blue-mid); }

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  margin-top: 0.5rem;
}

.contact-section { margin-bottom: 2.5rem; }

.contact-section h3 {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue-glow);
  margin-bottom: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
}

.contact-section p,
.contact-section address {
  font-size: 0.92rem;
  font-style: normal;
  line-height: 2;
  color: var(--off-white);
}

.contact-section a {
  color: var(--off-white);
  text-decoration: none;
  border-bottom: 1px solid var(--border-b);
  padding-bottom: 1px;
  transition: color 0.2s, border-color 0.2s;
}
.contact-section a:hover { color: var(--blue-glow); border-color: var(--blue-glow); }

/* Footer */
footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

footer span {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
}

footer .dot {
  width: 3px;
  height: 3px;
  background: var(--blue-mid);
  border-radius: 50%;
  display: inline-block;
}

/* Responsive */
@media (max-width: 680px) {
  .home-hero { grid-template-columns: 1fr; }
  .photo-placeholder, .home-photo { width: 140px; height: 140px; }
  .tool-item { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; gap: 0; }
  h2.page-title { font-size: 2rem; }
  .home-hero h1 { font-size: 2.4rem; }
}
