:root {
  --accent: #6666ff;
  --text: #2b2724;
  --bg: #efe9dc;
  --highlight: #f8e27a;
  --border: #545454;
  --line: #c8c8c8;
  --heading-font: "DM Mono", monospace;
  --body-font: "Instrument Sans", Arial, sans-serif;
  --name-font: "JetBrains Mono", monospace;
  --gutter: 3vw;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body-font);
  font-size: 17px;
  line-height: 1.6;
  font-weight: 420;
}

a { color: inherit; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { color: inherit; background: var(--highlight); }
::selection { background: var(--highlight); }

h1, h2 {
  font-family: var(--heading-font);
  font-weight: 400;
  text-transform: lowercase;
  letter-spacing: 0.03em;
  margin: 0;
}
h1 { font-size: 2.92rem; line-height: 0.9; }
h2 { font-size: 2.075rem; line-height: 0.94; color: var(--accent); }

p { margin: 0 0 1rem; }

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 28px;
  height: 56px;
  padding: 0 max(var(--gutter), calc((100% - 800px) / 2));
  background: var(--bg);
  border: 1px solid var(--line);
}
.logo { display: flex; align-items: center; gap: 5px; }
.logo img { display: block; height: 30px; width: auto; }
.site-nav { display: flex; gap: 18px; }
.site-nav a {
  font-family: var(--heading-font);
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--accent);
  text-decoration: none;
}
.site-nav a.active,
.site-nav a:hover { text-decoration: underline; color: var(--accent); background: none; }

/* ---------- page ---------- */
.page { padding: 72px var(--gutter) 96px; }

/* home */
.home { max-width: 800px; margin: 0 auto; padding-left: 0; padding-right: 0; }
.intro {
  display: grid;
  grid-template-columns: minmax(0, 600px) 140px;
  justify-content: space-between;
  align-items: start;
  gap: 40px;
}
.intro-text p, .news-list span { text-wrap: pretty; }
.intro h1 { margin-bottom: 0; font-weight: 500; }
.name-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 24px; margin-bottom: 26px; }
.name-row .pronouns { margin: 0; }
.pronouns { font-family: var(--heading-font); font-size: 0.8rem; letter-spacing: 0.02em; }
.pronouns mark { background: var(--highlight); color: inherit; padding: 0 2px; }

/* photo */
.photo-wrap { justify-self: end; width: 140px; margin: 110px 12px 0 0; }
.photo { position: relative; transform: rotate(3deg); }
.photo::before { content: ""; position: absolute; inset: 20px -10px -20px 10px; background: var(--accent); transform: rotate(-5deg); }
.photo .portrait { position: relative; display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: center 40%; padding: 2px; background: #fff; filter: grayscale(1) contrast(1.15) brightness(1); }

.kaomoji { font-size: 0.9em; letter-spacing: 0.02em; margin-left: 0.25em; color: #333; white-space: nowrap; position: relative; top: -1px; }

.job-note { margin: 0 0 20px; padding: 11px 14px; border: 1.5px solid var(--accent); color: var(--text); font-family: var(--heading-font); font-size: 13px; line-height: 1.8; text-wrap: balance; }
.job-note a { color: var(--text); text-decoration-color: var(--accent); }
.job-note a:hover { background: var(--highlight); color: var(--text); text-decoration-color: var(--text); }
.job-label { margin-right: 8px; color: var(--accent); }

/* contact */
.contact { margin-top: 1rem; font-family: var(--heading-font); font-size: 15px; line-height: 2.15; }
.contact .icon { display: inline-block; width: 2em; transform: scale(1.8); transform-origin: left center; position: relative; top: 0; }

.contact .icon-doc { transform: scale(1.4); top: 0; }
.contact .icon-mail { top: -1px; }
.contact .icon-inline { display: inline-block; margin: 0 1.05em 0 0.4em; transform: scale(1.35); position: relative; top: -1px; }

/* footer */
.site-footer { max-width: 800px; margin: 0 auto; padding: 20px 0 48px; border-top: 1px solid var(--line); font-family: var(--heading-font); font-size: 12px; color: #888; }

/* news */
.news { margin-top: 48px; }
.news h2 { font-size: 1.5rem; line-height: 1.2; padding-bottom: 4px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.news-list { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 14px 18px; font-size: 15px; line-height: 1.55; }
.news-date { font-family: var(--heading-font); font-size: 13px; color: var(--accent); text-transform: lowercase; padding-top: 2px; }
.news > .news-list .news-date:first-of-type { background: var(--highlight); color: var(--text); padding: 0 4px; margin-top: 2px; justify-self: start; height: fit-content; }

.news-more { margin-top: 14px; }
.news-more summary { display: inline-block; cursor: pointer; list-style: none; font-family: var(--heading-font); font-size: 13px; color: var(--accent); border-bottom: 1.5px solid var(--accent); }
.news-more summary::-webkit-details-marker { display: none; }
.news-more summary:hover { background: var(--highlight); }
.news-more .less, .news-more[open] .more { display: none; }
.news-more[open] .less { display: inline; }
.news-more[open] summary { order: 2; margin-top: 14px; }
.news-more[open] { display: flex; flex-direction: column; align-items: flex-start; }
.news-more .news-list { margin-top: 14px; width: 100%; }

/* publications */
.pubs { max-width: 800px; margin: 0 auto; padding-left: 0; padding-right: 0; }
.pubs h1 { font-weight: 500; margin-bottom: 16px; }
.name-note { max-width: 560px; margin-bottom: 28px; font-family: var(--heading-font); font-size: 13px; line-height: 1.8; color: #555; }
.pub-section { margin-bottom: 56px; }
.pub-section h2 { font-size: 1.5rem; line-height: 1.2; padding-bottom: 4px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.pub-note { font-family: var(--heading-font); font-size: 13px; font-weight: 400; color: #8a857c; margin: 0 0 24px; }
.pub-section h2 + .pub-list { margin-top: 24px; }
.pub-list { display: grid; grid-template-columns: 86px minmax(0, 1fr); gap: 22px 18px; }
.pub-id { font-family: var(--heading-font); font-size: 14px; color: var(--accent); padding-top: 3px; }
.pub p { margin: 0; }
.pub-title { font-weight: 560; line-height: 1.4; margin-bottom: 4px !important; }
.pub-meta { font-size: 15px; line-height: 1.55; color: #444; }
.pub-links { margin-top: 4px !important; font-family: var(--body-font); font-size: 12px; font-weight: 500; letter-spacing: 0.06em; color: #888; }
.pub-links a { color: var(--accent); text-decoration: none; border-bottom: 1.5px solid var(--accent); padding-bottom: 1px; }
.link-icon { color: var(--accent); margin-right: 4px; font-family: var(--heading-font); font-size: 16px; font-weight: 400; letter-spacing: 0; line-height: 1; position: relative; top: -1px; }
.link-icon-ext { top: -2px; }
.link-sep { margin: 0 10px; }
.pub-meta strong { font-weight: 600; color: var(--text); }
.pub-status { font-family: var(--heading-font); font-size: 12px; font-weight: 400; background: var(--highlight); color: var(--text); padding: 1px 5px; margin-left: 4px; white-space: nowrap; }

.pubs:not(.teach) .pub-id { color: #999; }
.pubs:not(.teach) .pub-title { margin-bottom: 0 !important; }
.pubs:not(.teach) .pub-meta { margin-top: 5px; font-size: 14px; line-height: 1.4; }
.pubs:not(.teach) .pub-list { grid-template-columns: 48px minmax(0, 1fr); }

/* teaching */
.teach .pub-list { grid-template-columns: 160px minmax(0, 1fr); }
.teach .pub-id { font-size: 12px; padding-top: 4px; line-height: 1.6; }
.teach-code { display: block; color: #999; }
.teach .pub-single { align-self: center; }
.teach .pub-single .pub-title { margin-bottom: 0 !important; }
.teach .pub-meta { font-size: 13px; color: #999; margin-top: -6.6px !important; }
.teach-subhead { grid-column: 1 / -1; justify-self: start; margin: 6px 0 -4px -4px; padding: 1px 6px; font-family: var(--heading-font); font-size: 13px; font-weight: 400; letter-spacing: 0.03em; color: var(--text); background: var(--highlight); }
.teach-subhead ~ .teach-subhead { margin-top: 18px; }
.teach .pub-list > .teach-subhead:first-child { margin-top: -14px; }
.teach-role { font-weight: 420; color: #555; }

/* ---------- small screens ---------- */
@media (max-width: 767px) {
  :root { --gutter: 16px; }
  .home, .pubs { padding-left: var(--gutter); padding-right: var(--gutter); }
  .site-footer { margin: 0 var(--gutter); }
  .page { padding-top: 40px; }
  .intro { grid-template-columns: 1fr; }
  .photo-wrap { order: -1; justify-self: start; margin: 0 0 24px 14px; width: 150px; }
  h1 { font-size: 2.3rem; }
  .pub-list { grid-template-columns: 44px minmax(0, 1fr); gap: 20px 12px; }
  .news-list { grid-template-columns: 1fr; gap: 2px; }
  .teach .pub-list { grid-template-columns: 1fr; gap: 2px; }
  .teach-code { display: inline; margin-left: 10px; }
  .teach .pub-single { align-self: start; }
  .teach .pub { margin-bottom: 16px; }
  .teach .pub-meta { margin-top: 0 !important; }
  .teach-subhead { margin-bottom: 10px; }
  .news-list > span:not(.news-date) { margin-bottom: 14px; }
  .site-header { gap: 16px; }
  .site-nav { gap: 12px; }
  .site-nav a { font-size: 14px; letter-spacing: 0.02em; }
  .logo img { height: 26px; }
}

@media (max-width: 360px) {
  .site-nav { gap: 9px; }
  .site-nav a { font-size: 13px; letter-spacing: 0; }
  .logo img { height: 24px; }
}
