/* yakovshkolnikov.com
   A document, not an app: one serif family, rules instead of boxes,
   hierarchy from size and weight, colour reserved for links. */

/* Source Serif 4, variable (opsz, wght), SIL Open Font License 1.1 */
@font-face {
  font-family: "Source Serif 4";
  font-style: italic;
  font-weight: 200 900;
  font-display: swap;
  src: url("/assets/fonts/source-serif-4-italic-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Source Serif 4";
  font-style: italic;
  font-weight: 200 900;
  font-display: swap;
  src: url("/assets/fonts/source-serif-4-italic-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("/assets/fonts/source-serif-4-normal-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("/assets/fonts/source-serif-4-normal-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #fdfcf9;
  --text: #1f1c19;
  --muted: #5f5851;
  --faint: #9a928a;
  --rule: #dcd6cc;
  --link: #7f1d1d;
  --link-hover: #5c1414;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --mono: "SF Mono", Menlo, Consolas, monospace;
  --wide: 58rem;
  --measure: 38rem;
  /* fluid type: scales smoothly from phone (360px) to desktop (1280px) */
  --step-0: clamp(1.06rem, 1rem + .25vw, 1.15rem);
  --step-1: clamp(1.15rem, 1.05rem + .45vw, 1.35rem);
  --step-2: clamp(1.35rem, 1.15rem + .9vw, 1.8rem);
  --step-3: clamp(1.9rem, 1.4rem + 2.2vw, 3rem);
  --step-4: clamp(2.3rem, 1.6rem + 3.2vw, 3.9rem);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #171513;
  --text: #e6e1da;
  --muted: #a69e95;
  --faint: #756d65;
  --rule: #3a352f;
  --link: #e8a0a0;
  --link-hover: #f5c6c6;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #171513;
    --text: #e6e1da;
    --muted: #a69e95;
    --faint: #756d65;
    --rule: #3a352f;
    --link: #e8a0a0;
    --link-hover: #f5c6c6;
    color-scheme: dark;
  }
}

/* page-to-page crossfade; article images glide between list and page */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .2s; }

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 var(--step-0)/1.6 var(--serif);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--link); text-decoration: underline; text-decoration-thickness: 1px;
    text-underline-offset: .18em; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); }
a:hover { color: var(--link-hover); text-decoration-color: currentColor; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }

img { max-width: 100%; height: auto; display: block; }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--bg); padding: .5rem 1rem; z-index: 10; }

.wrap { max-width: var(--wide); margin: 0 auto; padding: 0 1.25rem; }

/* header and footer */

.site-header .wrap {
  display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap;
  gap: .4rem 2rem; padding-top: 1.6rem; padding-bottom: 1rem; border-bottom: 1px solid var(--rule);
}
.site-name { font-size: 1.3rem; font-weight: 600; color: var(--text); text-decoration: none; letter-spacing: -.01em; }
.site-name:hover { color: var(--text); }
.site-nav { display: flex; flex-wrap: wrap; gap: .2rem 1.4rem; font-size: 1rem; }
@media (max-width: 30rem) { .site-nav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: .8rem; font-size: .9rem; max-width: 100%; } .site-nav a { white-space: nowrap; } }
.site-nav a { color: var(--muted); text-decoration: none; }
.site-nav a:hover { color: var(--text); }
.site-nav a[aria-current] { color: var(--text); font-weight: 600; }

.site-footer .wrap {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem;
  margin-top: 5rem; padding-top: 1.25rem; padding-bottom: 2.5rem;
  border-top: 1px solid var(--rule); font-size: .95rem; color: var(--muted);
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: .2rem 1.2rem; }
.site-footer a { color: var(--muted); }

/* shared */

main.wrap { padding-top: 2.75rem; }

h1, h2, h3, h4 { font-weight: 600; letter-spacing: -.01em; text-wrap: balance; }
p, li, dd, figcaption { text-wrap: pretty; }

.page-head { max-width: var(--measure); margin-bottom: 2.25rem; }
.page-head h1 { font-size: var(--step-3); line-height: 1.08; margin: 0 0 .8rem; letter-spacing: -.025em; }
.page-head p { margin: 0; color: var(--muted); }

h2.section { font-size: var(--step-2); line-height: 1.2; margin: 3.5rem 0 1.1rem; letter-spacing: -.015em; }
h2.section .more { font-size: 1rem; font-weight: 400; margin-left: .6rem; }
h3.sub { font-size: 1.1rem; font-style: italic; font-weight: 400; color: var(--muted); margin: 2rem 0 .75rem; }

.meta { color: var(--muted); font-size: .95rem; }
.sep { margin: 0 .35em; color: var(--faint); }
.ext::after { content: "\2009\2197"; font-size: .8em; }
.note { font-style: italic; color: var(--muted); }

.prose { max-width: var(--measure); }
.prose p { margin: 0 0 1rem; }

/* home */

.intro { max-width: 44rem; }
.intro h1 { font-size: var(--step-4); line-height: 1.02; margin: 0 0 .5rem; letter-spacing: -.03em; font-weight: 650; }
.intro .creds { margin: 0 0 1.4rem; color: var(--muted); font-style: italic; }
.intro p { margin: 0 0 1rem; font-size: var(--step-1); line-height: 1.5; }
.intro p.summary { font-size: 1.05rem; color: var(--muted); }
.intro .links { display: flex; flex-wrap: wrap; gap: .2rem 1.2rem; font-size: 1rem; }

.home-cols { display: grid; gap: 0 3.5rem; }
@media (min-width: 52rem) { .home-cols { grid-template-columns: 1fr 1fr; } }

/* lists: separated by space and a hairline, never boxed */

.list { list-style: none; margin: 0; padding: 0; }
.list > li { padding: 1rem 0 1.1rem; border-top: 1px solid var(--rule); }
.list > li:first-child { border-top: 0; padding-top: .25rem; }
.list h3 { font-size: 1.2rem; line-height: 1.3; margin: 0 0 .25rem; }
.list h3 a { color: var(--text); text-decoration: none; }
.list h3 a:hover { color: var(--link); text-decoration: underline; }
.list p { margin: .4rem 0 0; }
.compact > li { padding: .7rem 0 .75rem; }
.compact h3 { font-size: 1.08rem; margin-bottom: .1rem; }

/* writing index */

.filters { margin: 0 0 1.75rem; font-size: 1rem; color: var(--muted); line-height: 1.9; }
.filters button {
  font: inherit; color: var(--link); background: none; border: 0; padding: 0; cursor: pointer;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .18em;
  text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
}
.filters button[aria-pressed="true"] { color: var(--text); font-weight: 600; text-decoration: none; }
.filters .sep:last-child { display: none; }

.year { font-size: 1.1rem; font-weight: 400; font-style: italic; color: var(--muted); margin: 2.25rem 0 .5rem; }
.year:first-of-type { margin-top: 0; }

.entry { display: grid; grid-template-columns: 1fr; gap: 1.25rem; align-items: start; }
.entry.has-thumb { grid-template-columns: 1fr 8.5rem; }
.entry .thumb { width: 8.5rem; aspect-ratio: 3 / 2; object-fit: cover; margin-top: .3rem; }
.entry .desc { color: var(--muted); font-size: 1rem; line-height: 1.5; }
@media (max-width: 36rem) {
  .entry.has-thumb { grid-template-columns: 1fr 5rem; gap: .9rem; }
  .entry .thumb { width: 5rem; }
}

/* research */

.paper h3 { font-size: 1.25rem; }
.paper .summary { font-size: 1.02rem; line-height: 1.55; max-width: 44rem; }
.links-row { margin-top: .5rem; font-size: 1rem; }
.links-row > * + *::before { content: "·"; color: var(--faint); margin: 0 .45em; text-decoration: none; display: inline-block; }
.related { color: var(--muted); }
details.cite { margin-top: .4rem; font-size: 1rem; }
details.cite summary { cursor: pointer; color: var(--muted); width: max-content; }
details.cite pre { font: .8rem/1.5 var(--mono); margin: .5rem 0 0 1rem; overflow-x: auto; color: var(--muted); }

/* projects, lab: single column definition lists */

.items { margin: 0; }
.items dt { font-weight: 600; font-size: 1.1rem; margin-top: 1.2rem; }
.items dt:first-child { margin-top: 0; }
.items dd { margin: .2rem 0 0; max-width: 44rem; color: var(--muted); font-size: 1.02rem; line-height: 1.55; }
.items dd .links-row { margin-top: .25rem; }

/* about */

.timeline { margin: 0; }
.timeline > div { display: grid; grid-template-columns: 8rem 1fr; gap: 1.5rem; padding: .85rem 0; border-top: 1px solid var(--rule); }
.timeline > div:first-child { border-top: 0; padding-top: 0; }
.timeline dt { color: var(--muted); font-size: .95rem; font-variant-numeric: tabular-nums; padding-top: .1rem; }
.timeline dd { margin: 0; }
.timeline h3 { font-size: 1.1rem; margin: 0 0 .15rem; }
.timeline p { margin: 0; color: var(--muted); font-size: 1.02rem; line-height: 1.55; }
@media (max-width: 36rem) { .timeline > div { grid-template-columns: 1fr; gap: .15rem; } }

.principles h3 { font-size: 1.15rem; margin: 1.6rem 0 .3rem; }
.principles h3:first-child { margin-top: 0; }
.principles p { margin: 0; max-width: var(--measure); color: var(--muted); }

/* article */

.article-head { max-width: var(--measure); margin: 0 auto 2rem; }
.crumb { display: inline-block; font-size: 1rem; margin-bottom: 1.4rem; }
.article-head h1 { font-size: var(--step-3); line-height: 1.08; margin: 0 0 .9rem; letter-spacing: -.025em; }
.origin { margin: .6rem 0 0; font-size: .95rem; font-style: italic; color: var(--muted); }

.cover { max-width: 50rem; margin: 0 auto 2.5rem; }
.cover img { width: 100%; }
figcaption { font-size: .92rem; font-style: italic; color: var(--muted); margin-top: .55rem; text-align: center; }

.article-body { max-width: var(--measure); margin: 0 auto; font-size: clamp(1.1rem, 1.02rem + .4vw, 1.25rem); line-height: 1.7; }
.article-body > * { margin: 0 0 1.25rem; }
.article-body h2 { font-size: 1.55rem; line-height: 1.3; margin: 2.5rem 0 1rem; }
.article-body h3 { font-size: 1.3rem; line-height: 1.35; margin: 2.2rem 0 .8rem; }
.article-body blockquote { margin: 1.75rem 1.5rem; font-style: italic; }
.article-body ul, .article-body ol { padding-left: 1.4rem; }
.article-body li { margin-bottom: .45rem; }
.article-body figure { margin: 2.25rem 0; }
.article-body figure img { margin: 0 auto; }
@media (min-width: 60rem) { .article-body figure { margin-left: -5rem; margin-right: -5rem; } }
.article-body hr { border: 0; text-align: center; margin: 2.5rem 0; }
.article-body hr::before { content: "*\2003*\2003*"; color: var(--faint); }
.article-body pre { font: .88rem/1.55 var(--mono); margin-left: 1.5rem; overflow-x: auto; white-space: pre-wrap; }

.article-foot { max-width: var(--measure); margin: 3.5rem auto 0; padding-top: 1.25rem; border-top: 1px solid var(--rule); font-size: 1rem; }
.article-foot p { margin: 0 0 1rem; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-top: 2rem; }
.pager small { display: block; color: var(--muted); font-size: .9rem; font-style: italic; }
.pager .next { text-align: right; }

@media (max-width: 36rem) {
  main.wrap { padding-top: 2rem; }
}

@media print {
  .site-header, .site-footer, .filters, .pager { display: none; }
  body { background: #fff; color: #000; }
}

/* publication list */
.pubs { margin: 0; padding-left: 1.6rem; max-width: 46rem; font-size: 1rem; line-height: 1.5; }
.pubs li { margin-bottom: .6rem; padding-left: .2rem; }
.pubs li::marker { color: var(--faint); font-size: .9em; }
.pubs a { color: var(--text); }
.pubs a:hover { color: var(--link); }
details.more-pubs { margin-top: 2rem; }
details.more-pubs summary { cursor: pointer; font-style: italic; color: var(--muted); font-size: 1.1rem; margin-bottom: .75rem; }

/* images: quiet hover, no frames */
.thumb-link { display: block; }
.thumb-link img { transition: opacity .15s ease; }
.thumb-link:hover img { opacity: .85; }

/* home: lead story */
.lead { display: grid; gap: 1.25rem 2.5rem; margin: 3.25rem 0 0; align-items: start; }
@media (min-width: 48rem) { .lead { grid-template-columns: 7fr 5fr; } }
.lead-img img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.kicker { margin: 0 0 .4rem; font-style: italic; color: var(--muted); }
.lead h2 { font-size: var(--step-2); line-height: 1.15; margin: 0 0 .55rem; letter-spacing: -.02em; }
.lead h2 a, .tiles h3 a { color: var(--text); text-decoration: none; }
.lead h2 a:hover, .tiles h3 a:hover { color: var(--link); text-decoration: underline; }
.lead .meta { margin: 0 0 .75rem; }
.lead .desc { margin: 0; color: var(--muted); line-height: 1.55; }

/* home: tiles (image over headline, editorial rather than cards) */
.tiles { list-style: none; margin: 0; padding: 0; display: grid; gap: 2rem 1.75rem; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); }
.tiles img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.tiles h3 { font-size: 1.08rem; line-height: 1.3; margin: .65rem 0 .2rem; }
.tiles .meta { margin: 0; font-size: .9rem; }
.papers-row { grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr)); }
.page-thumb img { aspect-ratio: auto; border: 1px solid var(--rule); background: #fff; }
.papers-row h3 { font-size: 1rem; }

/* research: page thumbnail beside each paper */
.paper-row { display: grid; grid-template-columns: 7.5rem 1fr; gap: 1.5rem; align-items: start; }
.paper-row .page-thumb img { width: 7.5rem; }
@media (max-width: 36rem) { .paper-row { grid-template-columns: 4.5rem 1fr; gap: 1rem; } .paper-row .page-thumb img { width: 4.5rem; } }

/* projects / lab items with an image */
.items .with-img { display: grid; grid-template-columns: 1fr 9rem; gap: 1.25rem; }
.items .with-img img { width: 9rem; aspect-ratio: 3 / 2; object-fit: cover; margin-top: .2rem; }
.items dt a { color: var(--text); }
.items dt a:hover { color: var(--link); }

/* about */
.about-grid { display: grid; gap: 1.5rem 3rem; }
@media (min-width: 52rem) { .about-grid { grid-template-columns: minmax(0, 38rem) 1fr; align-items: start; } }
.about-grid figure { margin: 0; }
@media (min-width: 52rem) { .about-grid { grid-template-columns: minmax(0, 38rem) 15rem; justify-content: space-between; } }
.portrait img { width: 100%; max-width: 15rem; aspect-ratio: 1; object-fit: cover; }
.side-img img { width: 100%; max-width: 15rem; }
@media (max-width: 51.99rem) {
  .about-grid .portrait, .about-grid .side-img { order: -1; }
  .side-img img { max-width: 12rem; }
  .portrait img { max-width: 8.5rem; }
}
@media (max-width: 23rem) { .site-nav { gap: .6rem; font-size: .86rem; } }

/* theme toggle: plain text button in the header */
.theme-toggle {
  font: inherit; font-size: .95rem; color: var(--muted); background: none; border: 0; padding: 0; cursor: pointer;
  display: inline-flex; align-items: center; gap: .35rem;
}
.theme-toggle:hover { color: var(--text); }
.theme-toggle svg { width: 1em; height: 1em; }
.header-right { display: flex; align-items: baseline; gap: 1.4rem; flex-wrap: wrap; }
@media (max-width: 30rem) {
  .header-right { display: contents; }
  .site-header .wrap { align-items: center; }
  .theme-toggle { order: 2; margin-left: auto; }
  .site-nav { order: 3; width: 100%; }
}
.licensing { margin: 1.5rem 0 0; font-style: italic; }
