/*
  moshepoliak.com
  Warm paper, Newsreader serif, one quiet centered column.
  On wide screens, research notes (languages, collaborators) hang in the right margin.
*/

:root {
  --bg: #F8F5EF;
  --surface: #F0E9DE;
  --ink: #2A2420;
  --muted: #6B6158;
  --line: #E2DACD;
  --accent: #9A4630;
  --accent-soft: #F1E1D6;
  --link-line: #CFA492;
  --font: "Newsreader", Georgia, "Times New Roman", serif;
  --measure: 45rem;
  --note-width: 13rem;
  --note-gap: 2.5rem;
}

/* ---------- Base ---------- */

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.1875rem;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3 { color: var(--ink); text-wrap: balance; }
p { margin: 0 0 1em; text-wrap: pretty; }
img { max-width: 100%; height: auto; display: block; }

a {
  color: var(--ink);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .2em;
  text-decoration-color: var(--link-line);
  transition: text-decoration-color .15s ease, color .15s ease;
}
a:hover { text-decoration-color: currentColor; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
::selection { background: var(--accent-soft); color: var(--ink); }

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 20;
  padding: .5rem .8rem;
  background: var(--ink);
  color: var(--bg);
  text-decoration: none;
}
.skip-link:focus { top: 1rem; }

.nav ul, .langs, .pubs, .steps, .roster, .cv-list, .footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.muted { color: var(--muted); }
.small { font-size: .875em; }

/* ---------- Masthead ---------- */

.page { max-width: var(--measure); margin: 0 auto; padding: 0 1.5rem; }

.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem 2rem;
  padding: 2.5rem 0 1.25rem;
  border-bottom: 1px solid var(--line);
}
.name { margin: 0; font-size: 1.3rem; font-weight: 500; letter-spacing: -.005em; line-height: 1.3; }
.name a { color: var(--ink); text-decoration: none; }
.role { margin: .1rem 0 0; font-size: 1rem; font-style: italic; color: var(--muted); line-height: 1.4; }

.nav ul { display: flex; flex-wrap: wrap; gap: .25rem 1.4rem; }
.nav a { color: var(--muted); text-decoration: none; font-size: 1.05rem; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1.5px;
  text-underline-offset: .45em;
}

main { padding: 3.75rem 0 4.5rem; }

/* ---------- Home ---------- */

.hero { display: flex; flex-direction: column; }
.hero h1,
.page-head h1 {
  font-size: clamp(1.85rem, 1.2rem + 2.5vw, 2.55rem);
  line-height: 1.18;
  font-weight: 400;
  letter-spacing: -.012em;
  margin: 0 0 1.5rem;
}
.hero-links { font-size: 1.05rem; }
.hero .note { font-size: 1rem; font-style: italic; color: var(--muted); }

.portrait { order: -1; width: 8rem; margin: 0 0 1.5rem; }
.portrait img { width: 100%; border-radius: 6px; }

@media (min-width: 48rem) {
  .hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 10.5rem;
    column-gap: 2.75rem;
    align-items: start;
  }
  .portrait { order: 0; width: auto; margin: .6rem 0 0; }
}

/* ---------- Inner pages ---------- */

.page-head { margin-bottom: 1rem; }
.page-lede { color: var(--muted); max-width: 38rem; }

.section { margin-top: 3.5rem; }
.section > h2 {
  font-size: .78rem;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1.5rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
}

/* Entries: a project, course, or resource with an optional quiet meta line */
.entry { margin: 0 0 2rem; }
.entry h3 { font-size: 1.28rem; font-weight: 500; line-height: 1.3; margin: 0 0 .4rem; }
.entry h3 a { color: inherit; text-decoration: none; }
.entry h3 a:hover { text-decoration: underline; text-decoration-color: var(--link-line); }
.entry-body p { margin-bottom: .5rem; }
.entry .links { font-size: .95rem; color: var(--muted); }
.details { margin: .25rem 0 .75rem; padding-left: 1.2rem; }
.details li { margin-bottom: .35rem; }

.entry-meta { font-size: 1rem; font-style: italic; color: var(--muted); }
.entry-meta > * { display: inline; margin: 0; }
.entry-meta > :not(.label) ~ :not(.label)::before { content: " — "; }
.entry-meta .label { display: none; }

.langs li { display: inline; }
.langs li + li::before { content: " · "; }
.lang-native { display: none; }

/* Research notes: languages and collaborators set apart, in the margin on wide screens */
.with-notes .entry-meta { margin-top: .75rem; font-size: .9rem; font-style: normal; line-height: 1.5; }
.with-notes .entry-meta > * { display: block; margin: 0 0 .5rem; }
.with-notes .entry-meta > :not(.label) ~ :not(.label)::before { content: none; }
.with-notes .entry-meta .label {
  display: block;
  margin: .9rem 0 .3rem;
  font-size: .7rem;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.with-notes .entry-meta .label:first-child { margin-top: 0; }
.with-notes .langs li { display: grid; grid-template-columns: 1.9rem 1fr; align-items: baseline; }
.with-notes .langs li::before {
  content: attr(data-code);
  font-size: .66rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
}
.with-notes .lang-native { display: inline; color: var(--ink); }
.with-notes .lang-en { display: none; }

@media (min-width: 74rem) {
  .with-notes .entry {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--note-width);
    column-gap: var(--note-gap);
    margin-right: calc(-1 * (var(--note-width) + var(--note-gap)));
  }
  .with-notes .entry-body { grid-column: 1; }
  .with-notes .entry-meta {
    grid-column: 2;
    grid-row: 1;
    margin-top: .35rem;
    padding-top: .6rem;
    border-top: 1px solid var(--line);
  }
}

/* Teaching: steps, quotes, roster, course list */
.steps { counter-reset: step; }
.steps > li { counter-increment: step; position: relative; padding-left: 2.5rem; margin-bottom: 1.4rem; }
.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -.1rem;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--accent);
}
.steps h3 { margin: 0 0 .35rem; font-size: 1.15rem; font-weight: 500; }
.steps p { margin: 0; }

.quote { margin: 0 0 1.25rem; padding-left: 1.25rem; border-left: 2px solid var(--accent); }
.quote blockquote { margin: 0; }
.quote p { margin: 0; font-size: 1.25rem; font-style: italic; line-height: 1.45; }

.roster > li { padding: .7rem 0; border-top: 1px solid var(--line); }
.roster > li:last-child { border-bottom: 1px solid var(--line); }
.roster .who { font-weight: 600; }

.plain-list { margin: 0; padding-left: 1.2rem; }
.plain-list li { margin-bottom: .4rem; }

.callout { padding: 1.4rem 1.5rem; background: var(--surface); }
.callout h3 { font-size: 1.2rem; font-weight: 500; margin: 0 0 .5rem; }
.callout > :last-child { margin-bottom: 0; }
.section .callout { margin-bottom: 1.5rem; }

/* Publications */
.pubs > li { margin: 0 0 1.2rem; padding-left: 1.5rem; text-indent: -1.5rem; }
.pub .me { font-weight: 600; }
.pub .mentee::after { content: "‡"; }
.pub-venue { font-style: italic; }
.pub-links a { margin-left: .35rem; font-size: .88em; white-space: nowrap; }
.legend { font-size: .92rem; color: var(--muted); }

/* Resources: running prose */
.prose h3 { margin: 1.9rem 0 .5rem; font-size: 1.2rem; font-weight: 500; line-height: 1.3; }
.prose ul, .prose ol { margin: 0 0 1.1rem; padding-left: 1.3rem; }
.prose li { margin-bottom: .45rem; padding-left: .15rem; }

/* CV: date column + entry */
.cv-list > li { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); column-gap: 1.25rem; padding: .45rem 0; }
.cv-list .when { color: var(--muted); font-variant-numeric: tabular-nums; }
.cv-list .what p { margin: 0; }
.cv-list .detail { color: var(--muted); font-size: .92em; }
@media (max-width: 34rem) { .cv-list > li { grid-template-columns: 1fr; } }

/* ---------- Footer ---------- */

.footer {
  padding: 2rem 0 3rem;
  border-top: 1px solid var(--line);
  font-size: .9rem;
  color: var(--muted);
}
.footer ul { display: flex; flex-wrap: wrap; gap: .3rem 1.25rem; margin-bottom: .6rem; }
.footer p { margin: 0; }

/* Yellow marks = facts or files still to supply. None should remain at launch. */
mark.todo { background: #FFF1A8; color: inherit; padding: 0 .15em; border-radius: 3px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
