/* jonshon.com — single-column, text-first personal site.
   One palette, quiet dividers, no card grids or animation. */

:root {
  color-scheme: light;
  --bg: #f7f6f1;
  --text: #232520;
  --muted: #72756e;
  --line: #dedfd8;
  --chip: #eeeee8;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
img { max-width: 100%; height: auto; }

.wrap { width: min(100% - 48px, 760px); margin-inline: auto; }

/* ---------- header ---------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 100px;
  gap: 20px;
}
.brand {
  margin: 0;
  font-size: 21px;
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: -.035em;
  white-space: nowrap;
}
.nav { display: flex; align-items: center; gap: 32px; color: var(--muted); font-size: 14px; }
.nav a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 5px; }
.lang-switch {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .04em;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 5px;
}
.lang-switch:hover { background: var(--chip); text-decoration: none !important; }

/* ---------- hero ---------- */
.hero { padding: 80px 0 76px; }
.lead {
  max-width: 760px;
  margin: 0 0 16px;
  font-size: clamp(20px, 2.2vw, 24px);
  line-height: 1.7;
  letter-spacing: -.025em;
  font-weight: 600;
}
.intro {
  max-width: 660px;
  margin: 0 0 31px;
  color: #575b55;
  font-size: 17px;
  line-height: 1.9;
  letter-spacing: -.015em;
}

/* ---------- contact chips + QR popovers ---------- */
.contacts { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.contact-wrap { position: relative; display: inline-flex; }
.contact {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 15px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255,255,255,.28);
  color: #424640;
  font: inherit;
  font-size: 14px;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}
.contacts .contact { min-width: 108px; justify-content: center; }
.contact svg { width: 17px; height: 17px; flex: none; }
.contact .wechat-icon,
.contact .douyin-icon,
.contact .xianyu-icon { color: #424640; }
.contact:hover,
.contact[aria-expanded="true"] { background: var(--chip); }
a.contact { cursor: pointer; }

.qr-pop {
  position: absolute;
  left: 0;
  top: calc(100% + 10px);
  transform: translateY(-4px);
  width: 196px;
  padding: 14px 14px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fffefb;
  box-shadow: 0 12px 28px rgba(35,37,32,.10);
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity .14s ease, transform .14s ease, visibility .14s;
  z-index: 20;
}
.qr-pop img { display: block; width: 168px; height: 168px; object-fit: contain; margin: 0 auto; border-radius: 4px; }
.qr-pop figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.5;
}
.contact-wrap:hover .qr-pop,
.contact-wrap:focus-within .qr-pop,
.contact-wrap[data-open="true"] .qr-pop {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* ---------- sections ---------- */
.section { border-top: 1px solid var(--line); padding: 32px 0 56px; }
.now { border-top: 0; padding-top: 0; }
.section-head { display: block; }
.section-label {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -.01em;
}
.now .section-label { padding-bottom: 16px; border-bottom: 1px solid var(--line); margin-bottom: 26px; }
.now-item { margin: 0 0 19px; font-size: 16px; line-height: 1.85; }
.now-item:last-child { margin-bottom: 0; }
.text-link { text-decoration: underline; text-decoration-color: #a9ada6; text-underline-offset: 4px; }
.text-link:hover { text-decoration-color: currentColor; }

.writing { padding-bottom: 78px; }
.group { margin-bottom: 34px; }
.group:last-child { margin-bottom: 0; }
.group-title {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .015em;
}
.group-note { margin: 0 0 12px; color: var(--muted); font-size: 12.5px; line-height: 1.7; }
.essay {
  display: grid;
  grid-template-columns: minmax(0,1fr) 18px;
  gap: 16px;
  align-items: start;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  font-size: 16px;
  line-height: 1.6;
}
.essay:first-of-type { border-top: 1px solid var(--line); }
.essay:hover .essay-arrow { color: var(--text); }
.essay-arrow { color: #9ea29a; font-size: 17px; }

/* ---------- article ---------- */
.article { padding: 60px 0 40px; }
.article-head { padding-bottom: 30px; border-bottom: 1px solid var(--line); }
.article-kicker { margin: 0 0 18px; color: var(--muted); font-size: 13px; }
.article h1 {
  max-width: 760px;
  font-size: clamp(30px, 4vw, 42px);
  line-height: 1.3;
  letter-spacing: -.04em;
  white-space: normal;
}
.article-body {
  padding-top: 34px;
  font-size: 17px;
  line-height: 1.95;
  color: #3c3f39;
  letter-spacing: -.005em;
}
.article-body > * + * { margin-top: 1.15em; }
.article-body h2 {
  margin-top: 2.1em;
  font-size: 21px;
  line-height: 1.5;
  letter-spacing: -.02em;
  color: var(--text);
}
.article-body h3 { margin-top: 1.8em; font-size: 18px; line-height: 1.55; color: var(--text); }
.article-body p { margin: 0; }
.article-body ul, .article-body ol { margin: 0; padding-left: 1.35em; }
.article-body li + li { margin-top: .45em; }
.article-body blockquote {
  margin: 0;
  padding: 2px 0 2px 18px;
  border-left: 2px solid var(--line);
  color: #575b55;
}
.article-body a { text-decoration: underline; text-decoration-color: #a9ada6; text-underline-offset: 4px; }
.article-body a:hover { text-decoration-color: currentColor; }
.article-body img {
  display: block;
  margin: 1.6em auto;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.article-body code {
  padding: .12em .34em;
  border-radius: 4px;
  background: var(--chip);
  font-size: .92em;
}
.article-body pre {
  overflow-x: auto;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f0efe9;
}
.article-body pre code { padding: 0; background: none; }
.article-body hr { border: 0; border-top: 1px solid var(--line); margin: 2.2em 0; }
.article-body table { width: 100%; border-collapse: collapse; font-size: 15px; }
.article-body th, .article-body td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.article-foot { padding: 34px 0 8px; color: var(--muted); font-size: 14px; }
.article-foot a { color: var(--text); text-decoration: underline; text-underline-offset: 4px; }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 30px 0 70px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

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

/* ---------- small screens ---------- */
@media (max-width: 620px) {
  .wrap { width: min(100% - 38px, 760px); }
  .site-header { min-height: 78px; }
  .brand { font-size: 18px; }
  .nav { gap: 16px; font-size: 13px; }
  .hero { padding: 66px 0 70px; }
  .lead { font-size: 19px; line-height: 1.7; }
  .intro { margin: 0 0 27px; font-size: 15.5px; line-height: 1.85; }
  .contact { font-size: 13px; padding: 9px 11px; }
  .contacts .contact { min-width: 94px; }
  .qr-pop { width: 176px; padding: 12px 12px 10px; }
  .qr-pop img { width: 152px; height: 152px; }
  .section { padding: 25px 0 49px; }
  .group { margin-bottom: 30px; }
  .essay { font-size: 15px; }
  .article { padding: 40px 0 30px; }
  .article-body { font-size: 16px; line-height: 1.9; }
  .site-footer { padding-bottom: 44px; font-size: 11.5px; }
}

@media print {
  .site-header, .site-footer, .qr-pop { display: none; }
  body { background: #fff; }
}
