/* ============================================================
   Design tokens
   ============================================================ */
:root {
  --color-bg:        #FAF7F0;
  --color-text:       #1C1B19;
  --color-meta:       #6B5D4F;
  --color-accent:     #A23B2E;
  --color-rule:       #D9D2C3;

  --font-body: Charter, "Bitstream Charter", "Sitka Text", Georgia, serif;

  --measure: 38rem;       /* line length for body text */
  --margin-col-width: 4.5rem;
  --gap: 2rem;

  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.75rem;
  --space-4: 3rem;
  --space-5: 5rem;
}

/* ============================================================
   Reset
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: no-preference) {
  a { transition: color 0.15s ease, border-color 0.15s ease; }
}

h1, h2, h3, p, ol, ul, figure { margin: 0; }

a {
  color: var(--color-accent);
  text-decoration: none;
  border-bottom: 1px solid var(--color-rule);
}

a:hover {
  border-bottom-color: var(--color-accent);
  opacity: 0.75;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

/* ============================================================
   Page frame
   ============================================================ */
.page {
  max-width: 56rem;
  margin: 0 auto;
  padding: var(--space-5) var(--space-4) var(--space-4);
}

.rule {
  border: none;
  border-top: 1px solid var(--color-rule);
  margin: var(--space-4) 0;
}

/* ============================================================
   Masthead
   ============================================================ */
.masthead {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.kicker {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-meta);
  margin-bottom: var(--space-1);
}

.name {
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.role {
  margin-top: var(--space-1);
  color: var(--color-meta);
  font-style: italic;
  font-size: 1rem;
}

.masthead-nav {
  display: flex;
  gap: var(--space-3);
  font-size: 0.95rem;
}

.masthead-nav a {
  border-bottom: none;
}

.masthead-nav a:hover {
  border-bottom: 1px solid var(--color-accent);
}

/* ============================================================
   Section grid — marginalia column + content column
   ============================================================ */
.section {
  display: grid;
  grid-template-columns: var(--margin-col-width) minmax(0, 1fr);
  gap: var(--gap);
  padding: var(--space-4) 0;
}

.section + .section {
  border-top: 1px solid var(--color-rule);
}

.margin-col {
  padding-top: 0.3rem;
}

.margin-label {
  font-size: 0.8rem;
  color: var(--color-meta);
  letter-spacing: 0.08em;
}

.content-col {
  max-width: var(--measure);
}

.section-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: var(--space-3);
}

.content-col p {
  margin-bottom: var(--space-2);
}

.content-col p:last-child {
  margin-bottom: 0;
}

.content-col em {
  font-style: italic;
}

/* ============================================================
   About — profile image
   ============================================================ */
.about-inner {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
}

.about-text {
  flex: 1;
}

.profile-img {
  width: 200px;
  height: 250px;
  object-fit: cover;
  object-position: top center;
  border-radius: 4px;
  flex-shrink: 0;
}

/* ============================================================
   Latest News
   ============================================================ */
.news-list {
  list-style: none;
  padding: 0;
}

.news-item {
  display: grid;
  grid-template-columns: 6rem 1fr;
  gap: 0 var(--space-2);
  padding: 0.55rem 0;
  border-top: 1px solid var(--color-rule);
}

.news-item:last-child {
  border-bottom: 1px solid var(--color-rule);
}

.news-date {
  font-size: 0.85rem;
  color: var(--color-meta);
  padding-top: 0.1rem;
  white-space: nowrap;
}

.news-desc {
  font-size: 0.975rem;
  margin: 0;
}

/* ============================================================
   Education items
   ============================================================ */
.edu-item {
  margin-bottom: var(--space-3);
}

.edu-item:last-child {
  margin-bottom: 0;
}

.edu-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.edu-university {
  font-size: 1.05rem;
  font-weight: 700;
}

.edu-dates {
  font-size: 0.9rem;
  color: var(--color-meta);
  white-space: nowrap;
}

.edu-dept {
  margin-top: 0.15rem;
  margin-bottom: 0.1rem;
  font-style: italic;
}

.edu-place {
  font-size: 0.9rem;
  color: var(--color-meta);
}

/* ============================================================
   Publications — hanging citation style
   ============================================================ */
.pub-list {
  list-style: none;
  padding: 0;
  counter-reset: pub;
}

.pub-item {
  position: relative;
  padding-left: 2rem;
  margin-bottom: var(--space-3);
  counter-increment: pub;
}

.pub-item:last-child {
  margin-bottom: 0;
}

.pub-item::before {
  content: "[" counter(pub) "]";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--color-meta);
  font-size: 0.9rem;
}

.pub-title {
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.pub-authors {
  color: var(--color-text);
  margin-bottom: 0.15rem;
}

.pub-venue {
  color: var(--color-meta);
  font-style: italic;
  font-size: 0.95rem;
  margin-bottom: 0.35rem;
}

.pub-links {
  font-size: 0.9rem;
}

.pub-links a {
  border-bottom: none;
}

.pub-links a:hover {
  border-bottom: 1px solid var(--color-accent);
}

.pub-item--with-img {
  display: flex;
  gap: var(--space-2);
  align-items: flex-start;
}

.pub-body {
  flex: 1;
}

.pub-thumb {
  width: 130px;
  flex-shrink: 0;
  border-radius: 4px;
  display: block;
  margin-top: 0.1rem;
}

/* ============================================================
   CV / Contact
   ============================================================ */
.cv-link {
  border-bottom: none;
  font-weight: 700;
}

.contact-list {
  list-style: none;
  padding: 0;
  margin-top: var(--space-2);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
}

.contact-list li + li::before {
  content: "\00B7";
  color: var(--color-meta);
  margin: 0 0.6rem;
}

.contact-list a {
  border-bottom: none;
}

.contact-list a:hover {
  border-bottom: 1px solid var(--color-accent);
}

/* ============================================================
   Footer
   ============================================================ */
.footer {
  color: var(--color-meta);
  font-size: 0.85rem;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 640px) {
  .page {
    padding: var(--space-4) var(--space-2) var(--space-3);
  }

  .name {
    font-size: 1.8rem;
  }

  .masthead {
    align-items: flex-start;
  }

  .masthead-nav {
    gap: var(--space-2);
    flex-wrap: wrap;
  }

  .section {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .margin-col {
    padding-top: 0;
  }

  .about-inner {
    flex-direction: column-reverse;
  }

  .profile-img {
    width: 100px;
    height: 120px;
  }

  .pub-item--with-img {
    flex-direction: column;
  }

  .pub-thumb {
    width: 100%;
    max-width: 260px;
  }

  .edu-header {
    flex-direction: column;
    gap: 0.1rem;
  }
}
