@font-face {
  font-family: "Literata";
  src: url("fonts/literata-latin.woff") format("woff");
  font-weight: 400 650;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #ffffff;
  --ink: #18202c;
  --slate: #5a6474;
  --blue: #244c86;
  --blue-dark: #1b3b6a;
  --mist: #eef2f8;
  --rule: #dbe2ec;
  --serif: "Literata", Charter, "Iowan Old Style", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
          "Noto Sans CJK SC", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
body.en { font-family: var(--serif); font-size: 17px; line-height: 1.65; }
body.zh { font-family: var(--sans); font-size: 16px; line-height: 1.85; }
[lang="zh"] { font-family: var(--sans); }

img { max-width: 100%; display: block; }
p { margin: 0 0 1em; }
a { color: var(--blue); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--blue-dark); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 4px; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 28px; }

/* top band */
.top { background: var(--mist); margin-bottom: 56px; }
.top .hero { padding-bottom: 64px; }
body.zh .top .hero { padding-bottom: 40px; }
.top .facts { border-bottom: 0; border-top: 1px solid var(--rule); margin-bottom: 0; padding: 26px 0 34px; }

/* top bar */
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 22px 0; font-family: var(--sans); font-size: 15px; }
.topbar .home { color: var(--ink); text-decoration: none; font-weight: 600; }
.topbar nav { display: flex; gap: 24px; }
.topbar nav a { color: var(--slate); text-decoration: none; }
.topbar nav a:hover { color: var(--ink); }

/* hero */
.hero { display: grid; grid-template-columns: 300px 1fr; gap: 56px; align-items: center; padding: 36px 0 72px; }
.portrait { width: 300px; height: 300px; object-fit: cover; border-radius: 24px; box-shadow: 0 1px 2px rgba(24, 32, 44, .08), 0 12px 32px -12px rgba(24, 32, 44, .25); }
h1 { margin: 0; font-weight: 560; line-height: 1.05; }
body.en h1 { font-size: clamp(42px, 6vw, 62px); letter-spacing: -0.015em; }
body.zh h1 { font-size: clamp(38px, 5.2vw, 52px); letter-spacing: 0.06em; font-weight: 600; }
.alt-name { display: block; margin-top: 12px; color: var(--slate); font-size: 21px; font-weight: 400; letter-spacing: 0.1em; }
body.zh .alt-name { font-family: var(--serif); letter-spacing: 0.01em; }
.lede { font-size: 20px; line-height: 1.55; margin: 24px 0 28px; max-width: 34em; }
body.zh .lede { font-size: 19px; line-height: 1.75; margin: 22px 0 6px; }
.creds { color: var(--slate); margin: 0 0 26px; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; height: 44px; padding: 0 20px;
  border: 1px solid var(--rule); border-radius: 999px; background: var(--paper);
  color: var(--ink); text-decoration: none; font-family: var(--sans); font-size: 15px; cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.btn:hover { border-color: var(--blue); color: var(--blue); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); color: #fff; }

/* sections */
section { padding: 24px 0 56px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; margin-bottom: 8px; }
h2 { margin: 0; font-size: 28px; line-height: 1.25; font-weight: 600; }
body.zh h2 { font-size: 24px; letter-spacing: 0.04em; }
.section-head .aside { font-family: var(--sans); font-size: 14.5px; color: var(--slate); }
.measure { max-width: 690px; }

/* research threads */
.thread { display: grid; grid-template-columns: 300px 1fr; gap: 44px; padding: 36px 0; border-top: 1px solid var(--rule); }
.thread:first-of-type { border-top: 0; }
.thread figure { margin: 4px 0 0; }
.thread figure img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border: 1px solid var(--rule); border-radius: 14px; background: #fff; }
.thread figcaption { margin-top: 10px; font-family: var(--sans); font-size: 13px; line-height: 1.55; color: var(--slate); }
h3 { margin: 0 0 8px; font-size: 21px; line-height: 1.3; font-weight: 600; }
.thread .desc { margin-bottom: 22px; }

.paper { margin: 0 0 18px; }
.paper:last-child { margin-bottom: 0; }
.paper .title { display: block; font-weight: 600; color: var(--ink); text-decoration: none; line-height: 1.4; }
.paper a.title:hover { color: var(--blue); text-decoration: underline; }
.paper .authors { display: block; color: var(--slate); font-size: 15.5px; line-height: 1.5; margin-top: 3px; }
.paper .me { color: var(--ink); font-weight: 600; }
.paper .meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 4px; font-family: var(--sans); font-size: 14px; }
.paper .venue { color: var(--blue); font-weight: 600; }
.also { margin: 18px 0 0; padding-top: 14px; border-top: 1px dashed var(--rule); font-size: 15px; line-height: 1.6; color: var(--slate); }
.also a { color: var(--ink); text-decoration-color: #b9c4d3; }
.also a:hover { color: var(--blue); text-decoration-color: currentColor; }

/* teaching band (academic page) */
.band { background: var(--mist); }
.band .inner { display: grid; grid-template-columns: 1fr 380px; gap: 56px; align-items: center; padding: 64px 0; }
.bridge { background: var(--paper); border: 1px solid var(--rule); border-radius: 18px; padding: 26px 28px; font-family: var(--sans); }
.bridge h3 { font-family: var(--sans); font-size: 18px; margin-bottom: 6px; }
.bridge p { color: var(--slate); font-size: 15px; line-height: 1.7; margin-bottom: 18px; }

/* education */
.edu { margin-top: 12px; }
.edu-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 24px; padding: 16px 0; border-top: 1px solid var(--rule); }
.edu-row:first-child { border-top: 0; }
.edu-row .school { font-weight: 600; font-size: 19px; }
.edu-row .degree { color: var(--slate); grid-column: 1; }
.edu-row .place { color: var(--slate); font-family: var(--sans); font-size: 14.5px; grid-column: 2; grid-row: 1; align-self: center; }

footer { border-top: 1px solid var(--rule); padding: 26px 0 40px; font-family: var(--sans); font-size: 14px; color: var(--slate); }
footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
footer a { color: var(--slate); }

/* tutoring page */
.facts { display: flex; gap: 48px; flex-wrap: wrap; padding: 28px 0 30px; border-bottom: 1px solid var(--rule); margin-bottom: 48px; }
.facts div { display: flex; align-items: baseline; gap: 10px; }
.facts b { font-family: var(--serif); font-weight: 500; font-size: 34px; color: var(--blue); line-height: 1; }
.facts span { color: var(--slate); font-size: 15px; }

.rows { margin-top: 14px; }
.row { display: grid; grid-template-columns: 190px 1fr; gap: 24px; padding: 14px 0; border-top: 1px solid var(--rule); }
.row:first-child { border-top: 0; }
.row dt { font-weight: 600; }
.row dd { margin: 0; color: var(--slate); }

.steps { list-style: none; margin: 18px 0 40px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 30px 48px; counter-reset: step; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 44px 1fr; }
.steps li::before { content: counter(step); font-family: var(--serif); font-size: 30px; line-height: 1.1; color: var(--blue); font-weight: 500; }
.steps h3 { font-family: var(--sans); font-size: 17px; margin: 2px 0 4px; }
.steps p { margin: 0; color: var(--slate); }

.example { background: var(--mist); border-radius: 22px; padding: 34px 36px 30px; }
.example h3 { font-family: var(--sans); font-size: 17px; margin-bottom: 4px; }
.example .intro { color: var(--slate); margin-bottom: 20px; }
.example .stage { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: center; }
.example pre {
  margin: 0; padding: 20px 22px; background: var(--paper); border: 1px solid var(--rule); border-radius: 14px;
  font-family: var(--mono); font-size: 16px; line-height: 1.75; color: var(--ink); overflow-x: auto;
}
.example pre .c { color: #7a8494; }
.example svg { width: 100%; height: auto; }
.example .say { margin: 22px 0 0; padding-left: 16px; border-left: 3px solid var(--blue); }
.example .say p { margin: 0 0 6px; }
.example .say p:last-child { margin: 0; color: var(--slate); }

.contact { display: grid; grid-template-columns: 1fr auto; gap: 28px; align-items: center; border: 1px solid var(--rule); border-radius: 22px; padding: 30px 32px; }
.contact dl { margin: 0; display: grid; grid-template-columns: 64px 1fr; gap: 10px 16px; align-items: center; }
.contact dt { color: var(--slate); }
.contact dd { margin: 0; font-size: 17px; overflow-wrap: anywhere; }
.contact dd a { color: var(--ink); text-decoration: none; }
.contact dd a:hover { color: var(--blue); }
.contact .note { grid-column: 1 / -1; margin: 0; color: var(--slate); font-size: 14.5px; }
.contact .qr { width: 140px; height: 140px; border-radius: 12px; border: 1px solid var(--rule); background: #fff; }

/* what students and agencies said */
.voices { background: var(--mist); padding: 64px 0 64px; margin: 0 0 56px; }
.voices .intro { color: var(--slate); margin: 10px 0 30px; max-width: 690px; }
.voice-list { columns: 2; column-gap: 24px; }
.voice { break-inside: avoid; margin: 0 0 24px; background: var(--paper); border: 1px solid var(--rule); border-radius: 18px 18px 18px 6px; padding: 20px 22px 16px; }
.voice blockquote { margin: 0; font-size: 16.5px; line-height: 1.8; }
.voice .who { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: 12px; font-size: 13.5px; color: var(--slate); }
.voice .shot { white-space: nowrap; }

.viewer { border: 0; padding: 0; background: transparent; max-width: min(92vw, 700px); overflow: visible; }
.viewer::backdrop { background: rgba(24, 32, 44, .72); }
.viewer img { max-height: 80vh; width: auto; max-width: 100%; margin: 0 auto; border-radius: 12px; background: #fff; }
.viewer .btn { margin: 14px auto 0; display: flex; }

.qr-wrap { grid-column: 2; grid-row: 1 / span 2; margin: 0; text-align: center; font-size: 13px; color: var(--slate); }
.qr-wrap figcaption { margin-top: 8px; }
.contact .note { grid-column: 1; }

.copied { color: var(--blue); font-size: 14px; margin-left: 4px; }

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; gap: 28px; padding: 16px 0 52px; }
  .portrait { width: 168px; height: 168px; border-radius: 20px; }
  .lede { font-size: 18px; }
  .thread { grid-template-columns: 1fr; gap: 18px; padding: 30px 0; }
  .band .inner { grid-template-columns: 1fr; gap: 28px; padding: 48px 0; }
  .steps { grid-template-columns: 1fr; gap: 22px; }
  .example { padding: 24px 20px; }
  .example .stage { grid-template-columns: 1fr; }
  .row { grid-template-columns: 1fr; gap: 2px; }
  .facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 22px 0 24px; }
  .facts div { flex-direction: column; gap: 6px; }
  .facts b { font-size: 30px; }
  .facts span { font-size: 14px; }
  .contact { grid-template-columns: 1fr; padding: 24px 20px; }
  .qr-wrap { grid-column: 1; grid-row: auto; justify-self: start; text-align: left; }
  .voice-list { columns: 1; }
  .voices { padding: 48px 0; }
  .contact dl { grid-template-columns: 44px 1fr; gap: 10px 12px; }
  .contact dd { font-size: 16px; }
}
@media (max-width: 520px) {
  .wrap { padding: 0 20px; }
  .topbar nav { gap: 16px; }
  .topbar nav .optional { display: none; }
  body.en { font-size: 16.5px; }
  .section-head { flex-direction: column; gap: 2px; }
  .edu-row { grid-template-columns: 1fr; }
  .edu-row .place { grid-column: 1; grid-row: auto; }
}
