:root {
  --bg: #ffffff;
  --fg: #14161a;
  --muted: #5c6470;
  --link: #0b40c4;
  --rule: #e4e6ea;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121212;
    --fg: #e7e7e7;
    --muted: #9099a4;
    --link: #8ab0ff;
    --rule: #2a2c30;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: clamp(0.95rem, 0.9rem + 0.25vw, 1.05rem);
  line-height: 1.65;
  overflow-wrap: break-word;
}

main {
  max-width: 42rem;
  margin-inline: auto;
  padding: clamp(1.75rem, 5vw, 4rem) clamp(1.1rem, 5vw, 2rem);
}

@media (min-width: 1024px) {
  main {
    max-width: min(90vw, 64rem);
    padding-inline: clamp(2rem, 4vw, 3.5rem);
  }
}

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

a:hover {
  text-decoration: underline;
}

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

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
}

.math {
  font-style: italic;
}

.meta {
  color: var(--muted);
  font-size: 0.85em;
  overflow-wrap: anywhere;
}

.masthead {
  display: flex;
  align-items: center;
  gap: clamp(0.9rem, 3vw, 1.4rem);
  flex-wrap: wrap;
}

.avatar {
  width: clamp(76px, 18vw, 116px);
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 50%;
  flex-shrink: 0;
}

.identity {
  min-width: 0;
}

h1 {
  margin: 0;
  font-size: clamp(1.25rem, 1.05rem + 1.1vw, 1.7rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.handle {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.9em;
}

.bio {
  margin: 0.5rem 0 0;
  max-width: 42rem;
  font-size: 0.95em;
  line-height: 1.5;
}

.cv {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.6rem;
  margin: clamp(1.1rem, 3vw, 1.5rem) 0 0;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--rule);
  border-radius: 4px;
}

.toc {
  margin: clamp(1.1rem, 3vw, 1.5rem) 0 0;
}

.toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
}

.toc a {
  color: var(--muted);
  font-size: 0.85em;
}

section {
  margin-top: clamp(1.75rem, 5vw, 2.75rem);
}

h2 {
  margin: 0 0 0.9rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--rule);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.entries {
  list-style: none;
  margin: 0;
  padding: 0;
}

.entries > li + li {
  margin-top: 1.15rem;
}

.entry-title {
  margin: 0;
}

.entry-title strong {
  font-weight: 600;
}

.entry-line {
  margin: 0.1rem 0 0;
  font-size: 0.94em;
}

.split {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.1rem 0.9rem;
}

.split-main {
  min-width: 0;
}

.split-side {
  color: var(--muted);
  font-size: 0.85em;
  white-space: nowrap;
}

.points {
  list-style: none;
  margin: 0.3rem 0 0;
  padding: 0;
}

.points > li {
  position: relative;
  padding-left: 1.05rem;
  margin-top: 0.22rem;
  color: var(--muted);
  font-size: 0.93em;
}

.points > li::before {
  content: "\2022";
  position: absolute;
  left: 0.2rem;
  top: 0;
}

.points.flush > li::before {
  content: none;
}

section > .points > li {
  margin-top: 0.3rem;
}

section > .points > li:first-child {
  margin-top: 0;
}

#references .points > li {
  margin-top: 0.7rem;
}

#references .points > li:first-child {
  margin-top: 0;
}

.links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr));
  gap: 0.35rem clamp(1rem, 4vw, 2rem);
}

.links li {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.15rem 0;
}

@media (pointer: coarse) {
  .links li {
    padding: 0.4rem 0;
  }
}

footer {
  margin-top: clamp(2.5rem, 7vw, 4rem);
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.85em;
}

footer p {
  margin: 0;
}

@media print {
  :root {
    --bg: #ffffff;
    --fg: #000000;
    --muted: #444444;
    --link: #000000;
    --rule: #cccccc;
  }

  .avatar {
    display: none;
  }

  a::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
    color: #444444;
  }
}
