/* ==========================================================================
   Styles for _layouts/site.html: one quiet centred column, a light palette
   and a dark one (data-theme="dark" on <html>).
   ========================================================================== */

:root {
  --bg: #ffffff;
  --text: #1f2328;
  --text-2: #4e5864;
  --text-3: #6e7781;
  --rule: #e6e9ed;
  --surface: #f4f6f8;
  --accent: #2257c9;
  --accent-soft: #ebf1fd;
  --accent-line: rgba(34, 87, 201, 0.3);
  --photo-shadow: 0 0 0 1px rgba(31, 35, 40, 0.06), 0 12px 32px -8px rgba(31, 35, 40, 0.22);
  --ball-0: #ffd9bd;
  --ball-1: #f47b30;
  --ball-2: #b4460b;
  --trail: #ea6a1c;
  --ball-shadow: #0b2a5b;
  --ball-shadow-op: 0.28;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial,
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;

  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0e1117;
  --text: #e6edf3;
  --text-2: #a7b1bc;
  --text-3: #7d8896;
  --rule: #232a33;
  --surface: #171c23;
  --accent: #7aaaff;
  --accent-soft: #17233d;
  --accent-line: rgba(122, 170, 255, 0.35);
  --photo-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 12px 32px -8px rgba(0, 0, 0, 0.7);
  --ball-0: #ffe1c9;
  --ball-1: #ff9a4d;
  --ball-2: #c25510;
  --trail: #ffa657;
  --ball-shadow: #000000;
  --ball-shadow-op: 0.55;

  color-scheme: dark;
}

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

html {
  font-size: 106.25%; /* 17px */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
p,
ul {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

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

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

a:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

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

.icon {
  flex: none;
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon--solid {
  fill: currentColor;
  stroke: none;
}

.wrap {
  max-width: 736px; /* a 680px column */
  margin: 0 auto;
  padding: 0 28px;
}

/* -------------------------------------------------------------- header */
.site-header__inner {
  display: flex;
  align-items: center;
  height: 72px;
}

.site-header__brand {
  color: var(--text);
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.site-header__brand:hover {
  color: var(--accent);
  text-decoration: none;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0 -8px 0 auto;
}

.site-nav a {
  padding: 5px 11px;
  border-radius: 8px;
  color: var(--text-2);
  font-size: 0.88rem;
  font-weight: 500;
  transition: color 0.15s, background-color 0.15s;
}

.site-nav a:hover {
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}

.site-nav a[aria-current="page"] {
  color: var(--text);
}

.theme-toggle {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-left: 6px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: color 0.15s, background-color 0.15s;
}

.theme-toggle:hover {
  background: var(--surface);
  color: var(--text);
}

.theme-toggle .icon {
  width: 18px;
  height: 18px;
}

.icon-sun,
:root[data-theme="dark"] .icon-moon {
  display: none;
}

:root[data-theme="dark"] .icon-sun {
  display: block;
}

/* ---------------------------------------------------------------- hero */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 32px;
  margin: 40px 0 36px;
}

.hero__name {
  font-family: var(--font-serif);
  font-size: 2.6rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.1;
}

.hero__role {
  margin-top: 12px;
  color: var(--text-2);
  line-height: 1.55;
}

.hero__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin-top: 22px;
}

.hero__links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
}

.hero__links .icon {
  width: 17px;
  height: 17px;
  color: var(--text-3);
  transition: color 0.15s;
}

.hero__links a:hover {
  color: var(--accent);
  text-decoration: none;
}

.hero__links a:hover .icon {
  color: var(--accent);
}

.hero__photo {
  width: 168px;
  height: 168px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: var(--photo-shadow);
}

/* --------------------------------------------------------------- prose */
.prose p + p {
  margin-top: 1.05em;
}

.prose a,
.news a,
.entry__notes a {
  text-decoration: underline;
  text-decoration-color: var(--accent-line);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: text-decoration-color 0.15s;
}

.prose a:hover,
.news a:hover,
.entry__notes a:hover {
  text-decoration-color: currentColor;
}

/* ------------------------------------------------------------ sections */
.section {
  margin-top: 60px;
}

.section__title {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  color: var(--text-3);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  line-height: 1;
  text-transform: uppercase;
}

.section__title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rule);
}

.note {
  margin-top: 22px;
  color: var(--text-3);
  font-size: 0.8rem;
}

/* ------------------------------------------------------------ research */
.research {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 248px;
  align-items: center;
  gap: 28px;
}

.topics li + li {
  margin-top: 16px;
}

.topics h3 {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.45;
}

.topics p {
  margin-top: 2px;
  color: var(--text-2);
  font-size: 0.9rem;
  line-height: 1.5;
}

.research__art {
  position: relative;
}

.research__art img {
  display: block;
  width: 100%;
  height: auto;
}

.research__art .art-dark,
:root[data-theme="dark"] .research__art .art-light {
  display: none;
}

:root[data-theme="dark"] .research__art .art-dark {
  display: block;
}

/* the ball, drawn over the bowl and rolled by assets/js/bowl.js */
.bowl {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.bowl__trail {
  fill: none;
  stroke: var(--trail);
  stroke-width: 2.2;
  stroke-opacity: 0.8;
  stroke-dasharray: 2 5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bowl__ripple {
  fill: none;
  stroke: var(--trail);
  stroke-width: 1.6;
}

.bowl__shadow {
  fill: var(--ball-shadow);
  opacity: var(--ball-shadow-op);
}

/* ---------------------------------------------------------------- news */
.news li {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 16px;
  font-size: 0.95rem;
  line-height: 1.6;
}

.news li + li {
  margin-top: 10px;
}

.news time {
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

/* -------------------------------------------------------- publications */
.pub + .pub {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
}

.pub__title {
  color: var(--text);
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.45;
}

.pub__title:hover {
  color: var(--accent);
  text-decoration: none;
}

.pub__authors {
  margin-top: 6px;
  color: var(--text-2);
  font-size: 0.9rem;
  line-height: 1.55;
}

.pub__authors b {
  color: var(--text);
  font-weight: 600;
}

.pub__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 16px;
  margin-top: 10px;
  font-size: 0.82rem;
  line-height: 1.5;
}

.pub__venue {
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.pub__meta a {
  font-weight: 500;
}

/* -------------------------------------------------------- inner pages */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-top: 36px;
}

.page-title {
  margin-top: 36px;
  font-family: var(--font-serif);
  font-size: 2.3rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.15;
}

.page-head .page-title {
  margin-top: 0;
}

.page-lead {
  margin-top: 12px;
  color: var(--text-2);
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border: 1px solid var(--rule);
  border-radius: 9px;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 500;
  transition: color 0.15s, border-color 0.15s;
}

.button:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

.button .icon {
  width: 16px;
  height: 16px;
}

/* ------------------------------------------------------------------ CV */
.entry {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 24px;
}

.entry + .entry {
  margin-top: 20px;
}

.entry__when {
  padding-top: 2px;
  color: var(--text-3);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.6;
}

.entry__when span {
  display: block;
  font-style: italic;
}

.entry__what {
  font-weight: 600;
  line-height: 1.5;
}

.entry__where {
  color: var(--text-2);
  font-size: 0.95rem;
}

.entry__notes {
  margin-top: 6px;
  color: var(--text-2);
  font-size: 0.9rem;
  line-height: 1.6;
}

.entry__notes li {
  position: relative;
  padding-left: 16px;
}

.entry__notes li + li {
  margin-top: 3px;
}

.entry__notes li::before {
  content: "";
  position: absolute;
  top: 0.8em;
  left: 2px;
  width: 6px;
  height: 1px;
  background: var(--text-3);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tags li {
  padding: 3px 12px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--text-2);
  font-size: 0.85rem;
}

/* --------------------------------------------------- publication page */
.pub-page {
  margin-top: 40px;
}

.pub-page__title {
  margin-top: 16px;
  font-family: var(--font-serif);
  font-size: 1.9rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.pub-page .pub__authors {
  margin-top: 16px;
  font-size: 1rem;
}

.pub-page .pub__meta {
  margin-top: 14px;
  font-size: 0.9rem;
}

.pub-page .prose {
  margin-top: 28px;
}

/* -------------------------------------------------------------- footer */
.site-footer {
  margin-top: 88px;
}

.site-footer__inner {
  padding: 24px 0 40px;
  border-top: 1px solid var(--rule);
  color: var(--text-3);
  font-size: 0.78rem;
}

/* -------------------------------------------------------------- phones */
@media (max-width: 640px) {
  html {
    font-size: 100%;
  }

  .wrap {
    padding: 0 20px;
  }

  .site-header__inner {
    height: 60px;
  }

  .site-header__brand {
    display: none;
  }

  .site-nav a {
    padding: 5px 9px;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 20px;
    margin: 20px 0 28px;
  }

  .hero__photo {
    order: -1;
    width: 112px;
    height: 112px;
  }

  .hero__name {
    font-size: 2.15rem;
  }

  .section {
    margin-top: 48px;
  }

  .research {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .research__art {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
  }

  .news li {
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 12px;
  }

  .entry {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .page-title {
    font-size: 2rem;
  }
}
