:root {
  color-scheme: light;
  --ink: #161616;
  --muted: #686868;
  --rule: #dedede;
  --accent: #2456d6;
  --code: #f3f3f3;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: #fff;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

main {
  width: min(1080px, calc(100% - 40px));
  margin: 0 auto;
  padding: 72px 0;
}

.article-shell {
  width: min(700px, calc(100% - 40px));
  margin: 0 auto;
  padding: 72px 0;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 2;
  padding: 8px 12px;
  color: #fff;
  background: var(--ink);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

a {
  color: inherit;
  text-decoration-color: #b5b5b5;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

a:hover,
a:focus-visible {
  color: var(--accent);
  text-decoration-color: currentColor;
}

a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 72px;
  align-items: start;
  margin-bottom: 76px;
}

.portrait-frame,
.portrait {
  display: block;
  width: 100%;
}

.portrait {
  height: auto;
}

h1 {
  margin: 0;
  font-size: clamp(2.8rem, 9vw, 5.6rem);
  font-weight: 500;
  line-height: 0.95;
  letter-spacing: -0.065em;
}

.role {
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.summary {
  margin: 44px 0 28px;
  font-size: clamp(1.35rem, 3.2vw, 1.75rem);
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

section {
  margin-top: 68px;
}

h2 {
  margin: 0 0 26px;
  padding-top: 12px;
  border-top: 1px solid var(--rule);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.publication,
.writing-item {
  margin-bottom: 30px;
}

.publication h3,
.writing-item h3 {
  margin: 0 0 4px;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.4;
}

.authors {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.metadata,
.update time {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.item-links {
  margin-left: 8px;
}

.item-links a {
  margin-right: 8px;
}

.publications-more {
  margin-top: 4px;
}

.publications-more summary {
  margin-bottom: 0;
}

.publications-more[open] summary {
  margin-bottom: 30px;
}

.publications-hide-label {
  display: none;
}

.publications-more[open] .publications-show-label {
  display: none;
}

.publications-more[open] .publications-hide-label {
  display: inline;
}

.updates {
  display: grid;
  gap: 14px;
}

.update {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 12px;
}

.update p {
  margin: 0;
}

details {
  margin-top: 8px;
}

summary {
  width: fit-content;
  margin-bottom: 18px;
  cursor: pointer;
  font-size: 0.85rem;
}

details .update {
  margin-bottom: 14px;
}

footer {
  margin-top: 76px;
  color: var(--muted);
  font-size: 0.75rem;
}

.contact {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 24px;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
}

.contact-details {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
}

.last-updated {
  margin: 0 0 0 auto;
  white-space: nowrap;
}

.article-nav {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 76px;
  font-size: 0.85rem;
}

.article-header {
  margin-bottom: 52px;
}

.article-header h1 {
  font-size: clamp(2.4rem, 7vw, 4.8rem);
  line-height: 1;
}

.article-header p {
  color: var(--muted);
}

.article-body {
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.7;
}

.article-body h1,
.article-body h2,
.article-body h3 {
  margin: 2.2em 0 0.65em;
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.article-body h1 {
  font-size: 2rem;
}

.article-body h2 {
  font-size: 1.55rem;
}

.article-body h3 {
  font-size: 1.15rem;
}

.article-body img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  margin: 34px auto 10px;
}

.article-body .caption,
.article-body figcaption {
  margin: 0 auto 36px;
  color: var(--muted);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.76rem;
  text-align: center;
}

.article-body blockquote {
  margin: 28px 0;
  padding-left: 20px;
  border-left: 2px solid var(--rule);
  color: #3f3f3f;
}

.article-body pre {
  max-width: 100%;
  padding: 18px;
  overflow-x: auto;
  background: var(--code);
  font-size: 0.78rem;
  line-height: 1.55;
}

.article-body code {
  padding: 0.1em 0.28em;
  background: var(--code);
  font-family: "Courier New", Courier, monospace;
  font-size: 0.85em;
}

.article-body pre code {
  padding: 0;
  background: transparent;
}

.highlight .k,
.highlight .o,
.highlight .ow {
  color: #cf222e;
}

.highlight .k {
  font-weight: 600;
}

.highlight .nc,
.highlight .nd,
.highlight .nf {
  color: #8250df;
}

.highlight .bp,
.highlight .nb {
  color: #953800;
}

.highlight .mf,
.highlight .mi {
  color: #0550ae;
}

.highlight .s,
.highlight .sh {
  color: #0a3069;
}

.highlight .c1 {
  color: #6e7781;
  font-style: italic;
}

.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
  color: #6e7781;
  font-style: italic;
}

.token.keyword,
.token.operator {
  color: #cf222e;
}

.token.keyword {
  font-weight: 600;
}

.token.class-name,
.token.decorator,
.token.function {
  color: #8250df;
}

.token.boolean,
.token.number {
  color: #0550ae;
}

.token.builtin,
.token.char,
.token.string {
  color: #0a3069;
}

.token.constant,
.token.regex,
.token.variable {
  color: #953800;
}

.article-body d-contents {
  display: block;
  margin-bottom: 48px;
  padding: 20px;
  border: 1px solid var(--rule);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.82rem;
}

.article-body d-contents h3 {
  margin-top: 0;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.article-body d-contents ul {
  margin: 4px 0 10px;
}

.references {
  margin-top: 64px;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.82rem;
}

.references h2 {
  margin-top: 0;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.references li {
  margin-bottom: 12px;
  padding-left: 4px;
}

@media (max-width: 760px) {
  .intro {
    --mobile-portrait-size: clamp(112px, 24vw, 160px);

    position: relative;
    display: block;
  }

  .intro h1 {
    max-width: calc(100% - var(--mobile-portrait-size) - 20px);
  }

  .intro .role {
    max-width: calc(100% - var(--mobile-portrait-size) - 20px);
  }

  .portrait-frame {
    position: absolute;
    top: 0;
    right: 0;
    width: var(--mobile-portrait-size);
    height: var(--mobile-portrait-size);
    overflow: hidden;
  }

  .portrait {
    height: 100%;
    object-fit: cover;
    object-position: 50% 72%;
    transform: scale(1.85);
    transform-origin: 50% 72%;
  }
}

@media (max-width: 520px) {
  main,
  .article-shell {
    padding: 44px 0;
  }

  .intro,
  .article-nav {
    margin-bottom: 52px;
  }

  .contact {
    align-items: flex-start;
    flex-direction: column;
  }

  .last-updated {
    margin-left: 0;
  }

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

  .item-links {
    display: block;
    margin: 5px 0 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
