:root {
  --ink: #1E2A28;
  --ink-soft: #34423F;
  --paper: #EFEEE3;
  --paper-raised: #F8F7EF;
  --line: #C9C3AE;
  --line-soft: #DAD5C4;
  --accent: #3E6E5E;
  --accent-2: #A8461E;
  --text: #23302D;
  --text-muted: #5B6B66;
  --serif: 'Spectral', Georgia, serif;
  --sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--accent-2); color: var(--accent-2); }

.layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  max-width: 1180px;
  margin: 0 auto;
  min-height: 100vh;
}

/* Sidebar */

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  padding: 48px 36px 36px;
  border-right: 1px solid var(--line);
  overflow-y: auto;
}

.portrait {
  width: 108px;
  height: 108px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--paper-raised);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 22px;
}

.portrait img { width: 100%; height: 100%; object-fit: cover; display: block; }

.portrait .monogram {
  font-family: var(--serif);
  font-size: 34px;
  color: var(--accent);
}

.name {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 600;
  line-height: 1.25;
  margin: 0 0 6px;
  color: var(--ink);
}

.trace {
  display: block;
  width: 100%;
  height: 14px;
  margin: 4px 0 16px;
}

.trace path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-dasharray: 300;
  stroke-dashoffset: 300;
  animation: draw 1.4s ease-out 0.2s forwards;
}

@media (prefers-reduced-motion: reduce) {
  .trace path { animation: none; stroke-dashoffset: 0; }
}

@keyframes draw {
  to { stroke-dashoffset: 0; }
}

.role {
  font-size: 14.5px;
  color: var(--ink-soft);
  margin: 0 0 14px;
  font-weight: 500;
}

.dept, .addr, .phone {
  font-size: 13.5px;
  color: var(--text-muted);
  margin: 0 0 6px;
  line-height: 1.5;
}

.contact-block {
  padding-top: 14px;
  margin-top: 14px;
  border-top: 1px solid var(--line-soft);
}

.links {
  font-size: 13.5px;
  margin: 10px 0 0;
}

.links a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.links a:hover { color: var(--accent-2); }

nav.sections {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--line-soft);
}

nav.sections ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

nav.sections li { margin-bottom: 2px; }

nav.sections a {
  display: block;
  padding: 7px 0;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 14.5px;
  border-left: 2px solid transparent;
  padding-left: 12px;
  margin-left: -13px;
  transition: color .15s, border-color .15s;
}

nav.sections a:hover { color: var(--ink); }

nav.sections a.active {
  color: var(--ink);
  border-left-color: var(--accent-2);
  font-weight: 500;
}

.sidebar-footer {
  margin-top: 28px;
  font-size: 12px;
  color: var(--text-muted);
}

/* Main content */

main {
  padding: 56px 56px 100px;
  max-width: 720px;
}

section { margin-bottom: 64px; }
section:last-child { margin-bottom: 40px; }

section h2 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 4px;
}

section .section-rule {
  height: 1px;
  background: var(--line);
  margin: 10px 0 24px;
}

section h3 {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-soft);
  margin: 28px 0 10px;
}

section h3:first-of-type { margin-top: 4px; }

main p { margin: 0 0 14px; }

main ul, main ol {
  margin: 0 0 14px;
  padding-left: 22px;
}

main ul li, main ol li {
  margin-bottom: 9px;
  padding-left: 4px;
}

#publications h3 {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  color: var(--accent);
  margin: 30px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line-soft);
}

#publications h3:first-of-type { margin-top: 4px; }

#publications ul.pub-list {
  padding-left: 0;
  list-style: none;
}

#publications ul.pub-list li {
  position: relative;
  padding-left: 40px;
  margin-bottom: 14px;
  font-size: 14.5px;
  color: var(--ink-soft);
}

#publications .pub-num {
  position: absolute;
  left: 0;
  top: 0;
  color: var(--text-muted);
  font-size: 13px;
}

#projects p {
  border-top: 1px solid var(--line-soft);
  padding-top: 14px;
  margin-bottom: 0;
  padding-bottom: 14px;
}

#projects p:first-of-type { border-top: none; padding-top: 0; }

em { color: var(--ink-soft); font-style: italic; }
strong { font-weight: 600; color: var(--ink); }

.load-state, .error-state {
  color: var(--text-muted);
  font-size: 14px;
  padding: 40px 0;
}

/* Mobile */

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }

  .sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding: 32px 24px 24px;
  }

  nav.sections { margin-top: 24px; }

  nav.sections ul {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 18px;
  }

  nav.sections a { padding-left: 0; margin-left: 0; border-left: none; border-bottom: 2px solid transparent; padding-bottom: 4px; }
  nav.sections a.active { border-left-color: transparent; border-bottom-color: var(--accent-2); }

  main { padding: 40px 24px 80px; max-width: none; }
}
