:root {
  --paper:      #fbf5ec;
  --paper-alt:  #f4ead9;
  --ink:        #2b2420;
  --ink-soft:   #5c5148;
  --rule:       #e4d5bd;
  --terracotta: #c1622b;
  --terracotta-dark: #a24e1f;
  --indigo:     #2e4057;
  --maroon:     #7a2e2e;
  --card:       #ffffff;
  --shadow:     0 1px 2px rgba(43,36,32,0.06), 0 6px 20px rgba(43,36,32,0.06);
  --radius:     3px;
  --max-w:      920px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: 'Newsreader', Georgia, serif;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 0.5em;
}

a {
  color: var(--terracotta-dark);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

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

/* --- Nav --- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(251,245,236,0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--rule);
}
.site-nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  padding-bottom: 14px;
}
.site-nav .brand {
  font-family: 'Newsreader', serif;
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--ink);
}
.site-nav .brand span { color: var(--terracotta-dark); }
.site-nav ul {
  list-style: none;
  display: flex;
  gap: 22px;
  margin: 0;
  padding: 0;
}
.site-nav a {
  color: var(--ink-soft);
  font-size: 0.92rem;
  font-weight: 500;
}
.site-nav a:hover { color: var(--terracotta-dark); text-decoration: none; }

@media (max-width: 600px) {
  .site-nav .wrap { flex-wrap: wrap; gap: 8px 0; padding-top: 12px; padding-bottom: 12px; }
  .site-nav ul { gap: 14px; overflow-x: auto; width: 100%; }
  .site-nav a { font-size: 0.85rem; white-space: nowrap; }
}

/* --- Motif rule --- */
.motif {
  text-align: center;
  color: var(--terracotta);
  opacity: 0.55;
  font-size: 0.9rem;
  letter-spacing: 0.4em;
  margin: 8px 0 0;
}

/* --- Hero --- */
.hero {
  padding: 64px 0 40px;
}
.hero .grid {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 32px;
  align-items: center;
}
.hero .photo {
  width: 132px;
  height: 132px;
  border-radius: var(--radius);
  object-fit: cover;
  border: 4px solid var(--card);
  box-shadow: var(--shadow);
}
.hero h1 {
  font-size: 2.1rem;
  margin-bottom: 0.15em;
}
.hero .role {
  color: var(--ink-soft);
  font-size: 1.02rem;
  margin-bottom: 0.9em;
}
.hero .role strong { color: var(--ink); font-weight: 600; }
.hero p.lede {
  color: var(--ink-soft);
  max-width: 60ch;
}
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 188px;
  height: 40px;
  padding: 0 16px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid var(--rule);
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow);
}
.btn svg { flex: none; width: 16px; height: 16px; }
.btn:hover { text-decoration: none; border-color: var(--terracotta); color: var(--terracotta-dark); }
.btn.primary {
  background: var(--terracotta);
  border-color: var(--terracotta);
  color: #fff;
}
.btn.primary:hover { background: var(--terracotta-dark); color: #fff; }

@media (max-width: 560px) {
  .hero .grid { grid-template-columns: 1fr; text-align: center; }
  .hero .photo { margin: 0 auto; }
  .btn-row { justify-content: center; }
  .hero p.lede { margin-left: auto; margin-right: auto; }
}

/* --- Sections --- */
section { padding: 44px 0; }
section.alt { background: var(--paper-alt); }
.section-head { margin-bottom: 28px; }
.section-head .kicker {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--terracotta-dark);
  margin-bottom: 6px;
}
.section-head h2 { font-size: 1.6rem; margin-bottom: 6px; }
.section-head p { color: var(--ink-soft); max-width: 62ch; margin: 0; }

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}
.tag {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--radius);
  background: var(--paper-alt);
  color: var(--indigo);
  border: 1px solid var(--rule);
}

/* --- Cards / project grid --- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
@media (max-width: 560px) {
  .card-grid { grid-template-columns: 1fr; }
}
.card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.card h3 {
  font-size: 1.05rem;
  margin-bottom: 6px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.card .status {
  font-family: 'Inter', sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: var(--radius);
  white-space: nowrap;
}
.status.public { background: #e4f0e6; color: #2f6b3a; }
.status.private { background: #f0e6e0; color: var(--maroon); }
.card p {
  color: var(--ink-soft);
  font-size: 0.94rem;
  margin: 0 0 14px;
  flex-grow: 1;
}
.card .links {
  font-size: 0.85rem;
  font-weight: 600;
}
.card .links a { margin-right: 14px; }
.group-label {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--indigo);
  margin: 30px 0 14px;
}
.group-label:first-child { margin-top: 0; }

.repo-links-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin: 22px 0 10px;
}
.repo-links {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.repo-links a {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius);
  background: var(--card);
  color: var(--indigo);
  border: 1px solid var(--rule);
}
.repo-links a:hover {
  border-color: var(--terracotta);
  color: var(--terracotta-dark);
  text-decoration: none;
}

/* --- Bio / research --- */
.two-col {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 40px;
}
@media (max-width: 700px) {
  .two-col { grid-template-columns: 1fr; }
}
.aside-box {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
}
.aside-box h4 {
  font-size: 0.95rem;
  margin-bottom: 10px;
}
.aside-box ul { margin: 0; padding-left: 1.1em; color: var(--ink-soft); font-size: 0.92rem; }
.aside-box li { margin-bottom: 6px; }

/* --- Interests list --- */
.interests-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px 28px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.interests-list li {
  color: var(--ink-soft);
  padding-left: 1.3em;
  position: relative;
}
.interests-list li::before {
  content: "◆";
  position: absolute;
  left: 0;
  color: var(--terracotta);
  font-size: 0.7em;
  top: 0.35em;
}

/* --- Footer --- */
footer {
  border-top: 1px solid var(--rule);
  padding: 36px 0 48px;
  text-align: center;
}
footer .social {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-bottom: 14px;
  font-weight: 600;
  font-size: 0.92rem;
}
footer .fine {
  color: var(--ink-soft);
  font-size: 0.82rem;
}
