:root {
  color-scheme: light dark;
  --bg: #f7f2e8;
  --panel: #fffaf0;
  --text: #1f2933;
  --muted: #5f6670;
  --line: #d7cfc1;
  --accent: #375c52;
  --accent-strong: #203d37;
  --accent-soft: #dfe9e3;
  --focus: #b4492b;
  --shadow: none;
  --max: 900px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  line-height: 1.65;
}

a {
  color: inherit;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--accent-strong);
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: 1rem;
  z-index: 10;
  transform: translateY(-160%);
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  padding: 0.65rem 0.9rem;
}

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

.site-header,
.site-footer,
main {
  width: min(var(--max), calc(100% - 2rem));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  border-bottom: 1px solid color-mix(in srgb, var(--line), transparent 35%);
  background: color-mix(in srgb, var(--bg), transparent 8%);
  padding: 1rem 0;
  backdrop-filter: blur(14px);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 0.5rem 1rem;
  color: var(--muted);
  font-size: 0.94rem;
}

.site-nav a {
  text-decoration: none;
}

.language-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-width: 3.9rem;
  border: 1px solid color-mix(in srgb, var(--line), transparent 25%);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
  justify-content: center;
  line-height: 1;
  padding: 0.42rem 0.58rem;
}

.language-toggle:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent), transparent 35%);
  outline-offset: 2px;
}

.toggle-divider {
  color: var(--muted);
}

.toggle-en,
.toggle-zh {
  color: var(--muted);
}

html[lang="en"] .toggle-en,
html[lang="zh-CN"] .toggle-zh {
  color: var(--text);
  font-weight: 700;
}

[data-lang="zh"] {
  display: none;
}

html[lang="zh-CN"] [data-lang="en"] {
  display: none;
}

html[lang="zh-CN"] [data-lang="zh"] {
  display: revert;
}

.hero {
  max-width: 44rem;
  min-height: auto;
  padding: clamp(4.6rem, 10vw, 6.5rem) 0 clamp(4rem, 8vw, 5.5rem);
}

.eyebrow,
.section-kicker {
  margin: 0 0 0.75rem;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: clamp(2.9rem, 6.4vw, 4.15rem);
  line-height: 1.04;
  font-weight: 660;
}

h2 {
  margin: 0;
  font-size: clamp(1.9rem, 4vw, 3rem);
  line-height: 1.1;
}

h3 {
  margin: 0 0 0.45rem;
  font-size: 1.02rem;
  line-height: 1.35;
}

.role {
  margin: 0.85rem 0 0;
  color: var(--accent-strong);
  font-size: clamp(1.16rem, 2vw, 1.34rem);
  font-weight: 650;
}

.hero-summary {
  max-width: 39rem;
  margin: 1.35rem 0 0;
  color: var(--muted);
  font-size: 1.03rem;
  line-height: 1.75;
}

.hero-proof {
  max-width: 42rem;
  margin: 1rem 0 0;
  color: color-mix(in srgb, var(--accent-strong), var(--muted) 18%);
  font-size: 0.92rem;
  font-weight: 620;
}

.hero-proof [data-lang] {
  flex-wrap: wrap;
  gap: 0;
}

.proof-chip + .proof-chip::before {
  content: "·";
  margin-inline: 0 0.45rem;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.9rem;
}

.button {
  display: inline-flex;
  min-height: 2.65rem;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  padding: 0.58rem 0.95rem;
  text-decoration: none;
}

.button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.button.ghost {
  background: transparent;
}

.section {
  border-top: 1px solid var(--line);
  padding: clamp(3.5rem, 8vw, 6rem) 0;
}

.two-column,
.contact-section {
  display: grid;
  grid-template-columns: minmax(12rem, 0.45fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 5vw, 4rem);
}

.section-body {
  max-width: 50rem;
}

.section-body p {
  margin: 0;
  font-size: 1.05rem;
}

.section-body p + p {
  margin-top: 1rem;
}

.section-heading {
  max-width: 48rem;
  margin-bottom: 1.6rem;
}

.experience-grid,
.now-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  gap: 1rem;
  max-width: 54rem;
}

.experience-item,
.now-grid article {
  min-height: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: color-mix(in srgb, var(--panel), transparent 36%);
  padding: 1.05rem;
}

.experience-item p,
.now-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 0.96rem;
}

.updated {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.contact-copy {
  max-width: 42rem;
}

.contact-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
}

.contact-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  margin-top: 1.2rem;
}

.contact-inline a {
  color: var(--text);
  font-weight: 650;
  text-decoration: none;
}

.contact-inline .primary-link {
  color: var(--accent-strong);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid var(--line);
  padding: 1.5rem 0 2rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.site-footer p {
  margin: 0;
}

@media (max-width: 860px) {
  .site-header {
    align-items: center;
  }

  .site-nav {
    justify-content: flex-start;
  }

  .two-column,
  .contact-section {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .experience-grid,
  .now-grid {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 520px) {
  .site-header,
  .site-footer,
  main {
    width: min(var(--max), calc(100% - 1.5rem));
  }

  .site-header {
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
  }

  .site-nav {
    flex: 1;
    flex-wrap: nowrap;
    gap: 0.75rem;
    overflow-x: auto;
    width: auto;
    color: color-mix(in srgb, var(--muted), var(--text) 18%);
    font-size: 0.86rem;
    scrollbar-width: none;
  }

  .site-nav::-webkit-scrollbar {
    display: none;
  }

  .language-toggle {
    flex: 0 0 auto;
    margin-left: auto;
    min-width: 3.45rem;
    padding: 0.42rem 0.5rem;
  }

  .hero {
    display: block;
    padding: 2.45rem 0 2.6rem;
  }

  h1 {
    font-size: clamp(2.45rem, 12vw, 3.15rem);
    line-height: 1.05;
  }

  .role {
    margin-top: 0.65rem;
    font-size: 1rem;
    line-height: 1.45;
  }

  .hero-summary {
    margin-top: 1.25rem;
    color: color-mix(in srgb, var(--muted), var(--text) 12%);
    font-size: 0.98rem;
    line-height: 1.72;
  }

  .hero-proof {
    display: flex;
    flex-wrap: wrap;
    margin-top: 1rem;
    color: color-mix(in srgb, var(--accent-strong), var(--muted) 24%);
    font-weight: 600;
    line-height: 1.6;
  }

  .hero-proof [data-lang] {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
  }

  html[lang="en"] .hero-proof [data-lang="zh"],
  html[lang="zh-CN"] .hero-proof [data-lang="en"] {
    display: none;
  }

  .proof-chip {
    color: inherit;
    font-size: 0.86rem;
  }

  .proof-chip + .proof-chip::before {
    content: "/";
    margin-inline: 0.45rem;
    color: var(--muted);
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
    margin-top: 1.6rem;
  }

  .hero-actions .button.ghost {
    display: none;
  }

  .button {
    width: 100%;
    min-height: 2.65rem;
    padding: 0.62rem 0.8rem;
    font-size: 0.92rem;
  }

  .button:not(.primary) {
    background: color-mix(in srgb, var(--panel), transparent 36%);
  }

  .section {
    padding: 2.45rem 0;
  }

  .section-heading {
    margin-bottom: 0.9rem;
  }

  .section-kicker {
    margin-bottom: 0.45rem;
    font-size: 0.76rem;
  }

  h2 {
    font-size: 1.7rem;
  }

  .experience-grid,
  .now-grid {
    gap: 0.75rem;
  }

  .experience-item,
  .now-grid article {
    border-radius: 7px;
    padding: 1rem;
  }

  .contact-section {
    gap: 1rem;
  }

  .contact-inline {
    display: grid;
    gap: 0.65rem;
    margin-top: 1.15rem;
  }

  .contact-inline a {
    display: flex;
    min-height: 2.75rem;
    align-items: center;
    justify-content: space-between;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: color-mix(in srgb, var(--panel), transparent 38%);
    padding: 0.65rem 0.85rem;
  }

  .contact-inline a::after {
    content: "->";
    color: var(--muted);
    font-size: 0.85rem;
  }

  .contact-inline a[href^="mailto:"]::after {
    content: "->";
  }

  .contact-inline .primary-link {
    border-color: color-mix(in srgb, var(--accent), var(--line) 32%);
    background: var(--accent);
    color: #fff;
  }

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

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171717;
    --panel: #20201e;
    --text: #f1eee7;
    --muted: #bbb2a5;
    --line: #3a3833;
    --accent: #8fb7a6;
    --accent-strong: #c3dfd0;
    --accent-soft: #26342f;
    --focus: #ffb25f;
    --shadow: 0 24px 70px rgb(0 0 0 / 30%);
  }

  body {
    background:
      radial-gradient(circle at top right, rgb(143 183 166 / 8%), transparent 24rem),
      radial-gradient(var(--line) 0.7px, transparent 0.7px),
      var(--bg);
    background-size: auto, 24px 24px, auto;
  }

  .button.primary {
    color: #11231e;
  }

  .experience-item,
  .now-grid article {
    background: rgb(32 32 30 / 72%);
  }
}
