/* gsyunyaev.com, single stylesheet for the whole site.
 *
 * Fonts: IBM Plex Sans for everything on the page, IBM Plex Mono only
 * inside code and BibTeX blocks. Self-hosted under assets/fonts/ (SIL Open
 * Font License, see the LICENSE file there), Latin and Latin Extended
 * subsets only.
 *
 * Palette: Gruvbox dark by default, Gruvbox light when the visitor uses
 * the theme switch (html gets data-theme="light"). To try Monokai Pro,
 * replace the dark values with the ones in the comment block below :root.
 */

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("assets/fonts/IBMPlexSans-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: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("assets/fonts/IBMPlexSans-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: "IBM Plex Sans";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/IBMPlexSans-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: "IBM Plex Sans";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/IBMPlexSans-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: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/IBMPlexMono-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: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/IBMPlexMono-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;
}

:root {
  color-scheme: dark;
  --font-text: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --bg: #282828;        /* page background */
  --bg-code: #1d2021;   /* code and BibTeX blocks */
  --text: #ebdbb2;      /* body text */
  --heading: #fbf1c7;   /* name and section headings */
  --muted: #a89984;     /* title block, media line */
  --link: #83a598;      /* links and paper titles */
  --border: #504945;    /* section rules, code borders */
  --selection: #504945; /* text selection */
}

/* Monokai Pro alternative for the dark palette:
 *   --bg: #2d2a2e;  --bg-code: #221f22;  --text: #fcfcfa;  --heading: #fcfcfa;
 *   --muted: #939293;  --link: #78dce8;  --border: #5b595c;  --selection: #5b595c;
 */

/* Light palette (Gruvbox light), chosen with the switch. */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #fbf1c7;
  --bg-code: #f2e5bc;
  --text: #3c3836;
  --heading: #282828;
  --muted: #7c6f64;
  --link: #076678;
  --border: #d5c4a1;
  --selection: #d5c4a1;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
  padding: 36px 20px 56px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-text);
  font-size: 16px;
  line-height: 1.55;
}

::selection {
  background: var(--selection);
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover,
a:focus {
  text-decoration: underline;
}

a:focus {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

h1,
h2,
h3 {
  color: var(--heading);
  font-weight: 600;
  line-height: 1.2;
}

h1 {
  margin: 0 0 0.45rem;
  font-size: 2rem;
}

h2,
h3 {
  margin: 2.2rem 0 0.8rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--border);
  font-size: 1.25rem;
}

h3 {
  font-size: 1.1rem;
  border-top: 0;
  padding-top: 0;
  margin-top: 1.6rem;
}

p,
ul,
ol,
pre {
  margin: 0 0 1.1rem;
}

ul,
ol {
  padding-left: 1.35rem;
}

li {
  margin-bottom: 0.75rem;
}

b,
strong {
  font-weight: 600;
  color: var(--heading);
}

b a,
strong a {
  color: var(--link);
}

small,
footer,
.muted {
  color: var(--muted);
}

code,
pre {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

code {
  color: var(--heading);
  background: var(--bg-code);
  padding: 0.05em 0.3em;
  border-radius: 3px;
}

pre {
  overflow-x: auto;
  padding: 0.8rem;
  background: var(--bg-code);
  border: 1px solid var(--border);
  white-space: pre;
}

pre code {
  padding: 0;
  background: none;
}

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

/* Header block: headshot on the left, text on the right. The script in
 * _includes/head.html resizes the headshot to the exact height of
 * the text block; the width and height here are the no-script fallback. */

.profile-header {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.headshot {
  flex: 0 0 auto;
  width: 182px;
  height: 182px;
  object-fit: cover;
  border-radius: 8px;
}

.profile-intro {
  flex: 1 1 auto;
  min-width: 0;
}

.profile-intro .title {
  color: var(--muted);
  margin-bottom: 0.8rem;
}

/* Header links, separated by bars. The bar belongs to the link before it,
 * so a wrapped line ends with a bar rather than starting with one. */

.profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0;
  align-items: center;
  margin-bottom: 0;
}

.profile-links a {
  font-weight: 500;
}

.profile-links a:not(:last-child)::after {
  content: "|";
  display: inline-block;
  margin: 0 0.5rem;
  color: var(--muted);
}

/* Theme switch button, created by the script in _includes/head.html and
 * placed in the top right corner of the content column. */

.theme-toggle {
  position: absolute;
  top: 36px;
  right: 20px;
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  color: var(--link);
  border-color: var(--link);
  outline: none;
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-toggle .icon-moon {
  display: none;
}

:root[data-theme="light"] .theme-toggle .icon-sun {
  display: none;
}

:root[data-theme="light"] .theme-toggle .icon-moon {
  display: block;
}

/* Small pages (404): a one-line way back home. */

.site-nav {
  margin-bottom: 1.5rem;
  font-size: 0.95em;
}

/* Publication lists generated from the bib file. */

ul.pubs li {
  margin-bottom: 0.9rem;
}

/* Each bracketed link stays on one line and gets a comfortable tap height. */
.pub-links a {
  font-style: italic;
  display: inline-block;
  padding: 0.15em 0.1em;
  margin: -0.15em 0;
}

.toggle-body {
  margin-top: 0.55rem;
  color: var(--text);
}

.toggle-body pre {
  margin-top: 0.4rem;
}

.media-links {
  margin-top: 0.35rem;
  font-size: 0.92em;
  color: var(--muted);
}

.media-links a {
  font-weight: 500;
}

/* Hide anything Quarto might inject that we do not want. */

.quarto-title-block,
#title-block-header {
  display: none;
}

footer {
  margin-top: 2.6rem;
  font-size: 0.9em;
}

/* Narrow screens: headshot above the text at a fixed size. */

@media (max-width: 640px) {
  .profile-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .headshot {
    width: 120px;
    height: 120px;
  }
}

@media (max-width: 560px) {
  body {
    padding: 24px 16px 42px;
    font-size: 15px;
  }

  .theme-toggle {
    top: 24px;
    right: 16px;
  }

  h1 {
    font-size: 1.6rem;
  }
}

@media print {
  :root {
    color-scheme: light;
    --bg: #fff;
    --bg-code: #fff;
    --text: #111;
    --heading: #000;
    --muted: #444;
    --link: #111;
    --border: #999;
  }

  body {
    padding: 0.4in;
  }

  .toggle-body[hidden] {
    display: none;
  }

  .theme-toggle {
    display: none;
  }
}
