@font-face {
  font-family: "Lora";
  src: url("../fonts/Lora-Variable.ttf") format("truetype");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Lora";
  src: url("../fonts/Lora-Italic-Variable.ttf") format("truetype");
  font-weight: 400 700;
  font-style: italic;
  font-display: swap;
}

:root {
  --bg: #fdfdfd;
  --ink: #111111;
  --muted: #666666;
  --soft: #8a8a8a;
  --rule: #e8e8e8;
  --rule-soft: #f1f1f1;
  --link: #4d74eb;
  --code-bg: #f6f6f3;
  --measure: 750px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.6 "Lora", Georgia, "Times New Roman", serif;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
}

.wrapper {
  max-width: 780px;
  margin: 0 auto;
  padding-left: 15px;
  padding-right: 15px;
}

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

p { margin: 0 0 1.05em; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--rule);
  min-height: 56px;
}
.header-inner {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  min-height: 56px;
}
.site-title {
  color: #424242;
  font-size: 26px;
  font-weight: 400;
  line-height: 54px;
  white-space: nowrap;
}
.site-title:hover { text-decoration: none; color: #000; }
.site-nav {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0 20px;
  line-height: 54px;
  font-size: 16px;
}
.page-link { color: var(--ink); }
.lang-switch {
  display: inline-flex;
  gap: 10px;
  margin-left: 4px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.lang-switch a { color: var(--soft); }
.lang-switch a:hover { color: var(--ink); text-decoration: none; }

/* Main */
main.wrapper {
  padding-top: 42px;
  padding-bottom: 80px;
}

/* Home */
.intro {
  display: flex;
  align-items: flex-start;
  gap: 48px;
}
.intro-text { flex: 1 1 auto; min-width: 0; }
.intro-text p { font-size: 16px; line-height: 1.65; }
.intro-kicker {
  font-size: 17px !important;
  line-height: 1.55 !important;
  margin-bottom: 1.1em;
  color: #222;
}
.intro-links {
  margin-top: 1.4em;
  font-size: 15px;
  color: var(--muted);
}
.intro-links span { margin: 0 0.35em; color: var(--soft); }
.intro-mark {
  width: 240px;
  height: 240px;
  flex: 0 0 240px;
  border-radius: 50%;
  object-fit: cover;
  margin-top: 10px;
}

.section-label {
  margin: 52px 0 0;
  padding-top: 26px;
  border-top: 1px solid var(--rule);
  font-size: 21px;
  font-weight: 400;
  line-height: 1.3;
}

/* Post lists */
.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.post-item {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 24px;
  padding: 20px 0;
  border-bottom: 1px solid var(--rule-soft);
}
.post-item:last-child { border-bottom: 0; }
.post-date {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  padding-top: 3px;
}
.post-title-link {
  color: var(--ink);
  font-size: 18px;
  line-height: 1.4;
}
.post-title-link:hover { color: var(--link); }
.post-desc {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

/* List pages */
.list-header { margin-bottom: 18px; }
.list-header h1 {
  margin: 0 0 8px;
  font-size: 36px;
  font-weight: 400;
  line-height: 1.15;
}
.section-intro {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
  max-width: 620px;
}
.section-intro p:last-child { margin-bottom: 0; }

.term-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.term-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--rule-soft);
}
.term-count {
  color: var(--muted);
  font-size: 14px;
  margin-left: 6px;
}

/* Article */
.post-header { margin-bottom: 34px; }
.post-header h1 {
  margin: 0;
  font-size: 36px;
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.005em;
}
.post-meta {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}
.post-meta span { margin: 0 0.25em; }
.post-lede {
  margin: 16px 0 0;
  font-size: 18px;
  line-height: 1.55;
  color: #333;
  font-style: italic;
}
.post-body {
  font-size: 16px;
  line-height: 1.7;
}
.post-body p { margin: 0 0 1.15em; }
.post-body h2 {
  margin: 2.1em 0 0.55em;
  font-size: 27px;
  font-weight: 500;
  line-height: 1.25;
}
.post-body h3 {
  margin: 1.8em 0 0.45em;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
}
.post-body ul, .post-body ol {
  margin: 0 0 1.15em;
  padding-left: 1.4em;
}
.post-body li { margin-bottom: 0.35em; }
.post-body a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.post-body strong { font-weight: 600; }
.post-body hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 42px 0;
}
.post-body blockquote {
  margin: 1.6em 0;
  padding: 0 0 0 18px;
  border-left: 3px solid #dddddd;
  color: #555555;
  font-style: italic;
}
.post-body code {
  font-family: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
  font-size: 0.88em;
  background: var(--code-bg);
  padding: 0.12em 0.35em;
  border-radius: 3px;
}
.post-body pre {
  margin: 1.5em 0;
  padding: 16px 18px;
  background: var(--code-bg);
  border-radius: 4px;
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.5;
}
.post-body pre code {
  background: transparent;
  padding: 0;
  font-size: inherit;
  border-radius: 0;
}
.post-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.6em 0;
  font-size: 15px;
  line-height: 1.45;
}
.post-body th, .post-body td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}
.post-body th { font-weight: 600; }
.post-body figure { margin: 1.8em 0; }
.post-body img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  border-radius: 3px;
}
.post-body figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}

.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-top: 52px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
  font-size: 15px;
  line-height: 1.45;
}
.post-nav-next { margin-left: auto; text-align: right; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--rule);
  padding: 22px 0 30px;
  color: var(--muted);
  font-size: 14px;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--ink); }
.footer-links { display: inline-flex; gap: 16px; }

/* Mobile */
@media (max-width: 680px) {
  .header-inner {
    display: block;
    padding-top: 10px;
    padding-bottom: 10px;
  }
  .site-title { line-height: 1.2; display: inline-block; }
  .site-nav {
    display: flex;
    gap: 8px 16px;
    line-height: 2.1;
    font-size: 15px;
  }
  .lang-switch { margin-left: 0; }
  main.wrapper { padding-top: 28px; }
  .intro { display: block; }
  .intro-mark {
    display: block;
    width: 170px;
    height: 170px;
    flex-basis: auto;
    margin: 4px auto 26px;
  }
  .section-label { margin-top: 34px; padding-top: 20px; }
  .post-item {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 16px 0;
  }
  .post-date { padding-top: 0; }
  .post-header h1, .list-header h1 { font-size: 30px; }
  .post-body { font-size: 16px; }
  .post-nav { flex-direction: column; gap: 10px; }
  .post-nav-next { margin-left: 0; text-align: left; }
}
