:root {
  --bg: #fafafa;          /* warm cream background */
  --fg: #141414;          /* near-black text */
  --muted: #767676;       /* secondary text (meta) */
  --gray: #c4c4c4;        /* faint / placeholder text */
  --rule: #141414;        /* strong 2px divider rules */
  --max: 1120px;
  --top-space: 112px;     /* gap above the page content */
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.01rem;
  color: var(--fg);
  background: var(--bg);
}

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}

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

/* Emphasis: the reference uses bold weight rather than a highlight colour */
mark { background: transparent; color: inherit; font-weight: 700; }
em { font-style: italic; }

/* Header / nav */
.site-header {
  position: sticky;
  top: 0;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(180%) blur(6px);
  z-index: 10;
}
.nav {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-top: 22px;
  padding-bottom: 18px;
  flex-wrap: wrap;
}
.nav-links { display: flex; align-items: baseline; gap: 18px; flex-wrap: wrap; margin-left: auto; }
.nav-links > a { color: var(--fg); }

main.container { padding-top: var(--top-space); padding-bottom: 80px; }

/* Intro */
.intro { margin-bottom: 24px; }
.headline { font-size: calc(1.3rem + 0.7vw); font-weight: 400; margin: 0 0 0.5em; line-height: 1.3; }
.location { color: var(--muted); margin: 0 0 1.2em; }
.bracket-links a {
  display: inline-block;
  margin: 3px 3px;
  padding: 2px 7px;
  color: var(--fg);
  transition: 0.2s;
}
.bracket-links a:hover { background: var(--fg); color: var(--bg); text-decoration: none; }

h1 { font-size: calc(2rem + 1vw); font-weight: 700; margin: 0 0 0.3em; }

/* Section headings sit above a strong 2px rule, mirroring the block dividers */
h3 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--fg);
  border-top: 2px solid var(--rule);
  padding-top: 16px;
  margin-top: 56px;
  margin-bottom: 8px;
}

.small { font-size: 0.85rem; font-weight: 400; color: var(--muted); }
.muted { color: var(--muted); }

/* Articles */
.article-list { list-style: none; padding: 0; margin: 0; }
.article-list li { font-size: 0.85rem; line-height: 1.35rem; margin-bottom: 12px; }
.article-list .tag { font-weight: 700; }
.article-list em { font-style: italic; }

/* Works */
.featured { margin-top: 0; }
.work-card {
  padding: 26px 0 32px;
  border-top: 2px solid var(--gray);
}
.featured .work-card:first-child { border-top: none; padding-top: 0; }
.work-cover {
  display: block;
  width: 100%;
  margin-bottom: 16px;
}
.work-cover img { width: 100%; height: auto; object-fit: cover; display: block; }
.cover-placeholder {
  display: flex; align-items: center; justify-content: center;
  height: 100%; font-size: 3rem; font-weight: 700; color: var(--gray);
}
.work-title { font-size: 1.05rem; font-weight: 700; margin: 0 0 0.4em; line-height: 1.25; }
.work-title a { color: var(--fg); }
.work-title a:hover { text-decoration: underline; text-decoration-thickness: 3px; }
.work-authors { margin: 0 0 0.6em; font-size: 0.88rem; color: var(--muted); }
.work-summary { margin: 0 0 0.9em; font-size: 0.95rem; }
.work-meta { font-size: 0.8rem; color: var(--muted); display: flex; gap: 18px; flex-wrap: wrap; margin: 0; }
.work-meta span > a, .work-meta a { color: var(--fg); }

/* Detail page */
.detail-cover { width: 100%; margin: 20px 0; }
.lead { font-size: 1.1rem; }

.prose { max-width: 64ch; font-size: 0.95rem; line-height: 1.55; }

/* About / contact spacing */
.about .prose { margin-top: 12px; }
.contact { margin-bottom: 40px; }

/* Footer */
.site-footer {
  color: var(--muted);
  font-size: 0.9rem;
  padding: 28px 0 56px;
  margin-top: 48px;
  text-align: right;
}
.site-footer p { margin: 2px 0; }
.site-footer a { color: var(--fg); }

/* Two-column home: fixed identity on the left, scrolling work on the right */
.home-layout {
  display: grid;
  grid-template-columns: minmax(200px, 35%) 1fr;
  gap: 0;
  align-items: start;
}
.home-left {
  position: fixed;
  top: calc(var(--top-space) + 64px); /* 64px = sticky header height */
  /* % here is the viewport minus the scrollbar (unlike vw), so the panel
     lines up exactly with the grid's left column. */
  left: max(24px, calc((100% - var(--max)) / 2 + 24px));
  width: max(200px, calc((min(100%, var(--max)) - 48px) * 0.35));
  padding-right: 30px;
  text-align: center;
}
.no-header .home-left { top: var(--top-space); }
.home-right {
  grid-column: 2;
  border-left: 2px solid var(--rule);
  padding-left: 30px;
  min-width: 0;
}
.home-name { font-size: calc(1.4rem + 0.6vw); font-weight: 700; margin: 0 0 0.35em; line-height: 1.15; }
.home-left .headline { font-size: 1.05rem; font-weight: 400; margin: 0 0 0.5em; line-height: 1.35; }
.home-left .headline:has(+ .affiliation) { margin-bottom: 0.1em; }
.home-left .affiliation { font-size: 1.05rem; margin: 0 0 0.5em; line-height: 1.35; }
.home-left .email { font-size: 0.85rem; margin: 0 0 1.2em; }
.home-left .bracket-links { margin: 0; }

/* Headings in the right column carry no top divider of their own —
   About gets its own rule directly under its heading instead. */
.home-right h3 { margin-top: 0; border-top: none; padding-top: 0; }
.about { margin-bottom: 48px; }
.home-right .prose { max-width: none; }
.about h3 {
  border-bottom: 2px solid var(--rule);
  padding-bottom: 10px;
  margin-bottom: 16px;
}

@media (max-width: 820px) {
  :root { --top-space: 56px; }
  .home-layout { grid-template-columns: 1fr; }
  .home-left {
    position: static;
    width: auto;
    padding-right: 0;
    padding-bottom: 28px;
    margin-bottom: 8px;
    border-bottom: 2px solid var(--rule);
  }
  .home-right { grid-column: 1; border-left: none; padding-left: 0; }
  .home-right > section:first-child h3 { margin-top: 20px; }
}

/* Work detail: breaks out of the .container's side padding but stays
   capped at the same width (--max) as the rest of the site, so it
   doesn't stretch edge-to-edge on wide screens. */
.work-detail {
  width: 100vw;
  max-width: var(--max);
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  padding: 0 36px;
}
.work-detail .back { color: var(--muted); margin-bottom: 28px; }

/* Title spans the full width across the top */
.detail-header { margin-bottom: 48px; }
.detail-title { font-size: calc(1.3rem + 0.4vw); font-weight: 700; line-height: 1.15; margin: 0; }
.detail-authors { margin: 0.6em 0 0; }

.detail-layout {
  display: grid;
  grid-template-columns: minmax(220px, 30%) 1fr;
  gap: 0;
  align-items: start;
}
.detail-left {
  position: sticky;
  top: 96px;
  align-self: start;
  padding-right: 40px;
}
.no-header .detail-left { top: 56px; }
.detail-right {
  border-left: 2px solid var(--rule);
  padding-left: 40px;
  min-width: 0;
}
.detail-meta { margin: 0 0 20px; }
.meta-row { margin-bottom: 14px; }
.meta-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 2px;
}
.meta-value { display: block; font-size: 0.95rem; }
.meta-value a { color: var(--fg); }
.detail-links { margin: 0; }
.detail-right .detail-cover { margin-top: 0; }
.detail-right .lead { margin-top: 0; }
.detail-right .prose { max-width: none; }

@media (max-width: 820px) {
  .work-detail { width: auto; max-width: none; position: static; left: auto; transform: none; padding: 0; }
  .detail-layout { grid-template-columns: 1fr; }
  .detail-left {
    position: static;
    padding-right: 0;
    padding-bottom: 24px;
    margin-bottom: 8px;
    border-bottom: 2px solid var(--rule);
  }
  .detail-right { border-left: none; padding-left: 0; }
}
