/* Leonid Popryho — plain, static personal page. No web fonts; the only script is the GoatCounter counter. */

:root {
  --font: Charter, "Bitstream Charter", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --bg: #ffffff;
  --text: #1b1b1b;
  --muted: #6a6a6a;
  --rule: #d8d8d8;
  --rule-light: #ececec;
  --link: #0645ad;
  --link-underline: #b9c8e6;
  --thumb: 160px;
}

* { box-sizing: border-box; }

html { font-size: 17px; }

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

.page {
  max-width: 880px;
  margin: 0 auto;
  padding: 48px 28px 56px;
}

a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  text-decoration-color: var(--link-underline);
}
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }

h1 {
  margin: 0 0 4px;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
h2 {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin: 44px 0 14px;
  padding-bottom: 6px;
  font-size: 1.25rem;
  font-weight: 700;
  border-bottom: 1px solid var(--rule);
}
h2 .aside { font-size: 0.85rem; font-weight: 400; white-space: nowrap; color: var(--muted); }
h3 {
  margin: 28px 0 10px;
  font-size: 1.05rem;
  font-weight: 700;
}
p { margin: 0 0 1em; }
b { font-weight: 700; }
img { max-width: 100%; height: auto; }

/* masthead */
.masthead {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 28px;
}
.masthead-text { min-width: 0; }
.subtitle { margin: 0 0 10px; color: var(--muted); }
.subtitle em { color: var(--text); }
.contact { margin: 0; font-size: 0.95rem; }
.portrait {
  flex: none;
  width: 140px;
  height: 140px;
  border-radius: 3px;
  object-fit: cover;
}

/* section links */
.toc {
  margin: 28px 0 4px;
  padding: 9px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  font-size: 0.95rem;
  color: var(--muted);
}

/* date | text rows (news, honors, experience, education) */
.rows {
  display: grid;
  grid-template-columns: 168px 1fr;
  gap: 8px 20px;
  margin: 0;
}
.rows dt { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rows dd { margin: 0; }

/* thumbnail | text entries (publications, conferences) */
.entries { list-style: none; margin: 0; padding: 0; }
.entries li {
  display: grid;
  grid-template-columns: var(--thumb) 1fr;
  gap: 0 22px;
  padding: 12px 0;
  border-bottom: 1px solid var(--rule-light);
}
.entries li:last-child { border-bottom: 0; }
.thumb { display: block; line-height: 0; }
.thumb img {
  max-width: var(--thumb);
  max-height: var(--thumb);
  border: 1px solid var(--rule-light);
  background: #fff;
}
.thumb.placeholder {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  width: var(--thumb);
  height: calc(var(--thumb) * 0.75);
  border: 1px dashed var(--rule);
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.2;
  text-align: center;
}
.thumb.placeholder small { font-size: 0.8rem; }
.entries .title { font-weight: 700; color: var(--text); text-decoration: none; }
.entries a.title:hover { text-decoration: underline; text-decoration-color: currentColor; }
.entries i { color: #444; }
.entries .links { color: var(--muted); white-space: nowrap; margin-left: 4px; }
.entries .links a { color: var(--link); }
.entries .note { color: var(--muted); }

/* projects, misc */

/* footer */
footer {
  margin-top: 56px;
  padding-top: 12px;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.9rem;
}

/* draft-only marker for facts to confirm; delete the <span class="todo"> elements when done */
.todo {
  display: inline-block;
  padding: 0 5px;
  font-family: var(--mono);
  font-size: 0.7em;
  line-height: 1.6;
  color: #8a5608;
  border: 1px dashed #c99a3d;
  border-radius: 3px;
  vertical-align: middle;
  white-space: nowrap;
}

@media (max-width: 600px) {
  html { font-size: 16px; }
  .page { padding: 28px 18px 40px; }
  .masthead { flex-direction: column-reverse; gap: 16px; }
  .portrait { width: 96px; height: 96px; }
  h2 { flex-wrap: wrap; }
  .rows { grid-template-columns: 1fr; gap: 2px 0; }
  .rows dt { margin-top: 10px; white-space: normal; }
  .rows dt:first-child { margin-top: 0; }
  .entries li { grid-template-columns: 1fr; gap: 8px 0; }
  .entries .links { white-space: normal; }
  .todo { white-space: normal; }
}

@media print {
  .toc, .todo { display: none; }
  a { color: inherit; text-decoration: none; }
  .page { padding: 0; max-width: none; }
}
