/* =========================================================================
   Wesley Weng — personal site
   Aesthetic: clean light / executive. Warm paper, ink-navy accent,
   serif display headings, generous whitespace, hairline rules.
   ========================================================================= */

:root {
  --paper: #fbfaf7;
  --paper-2: #f4f2ec;
  --ink: #1b1b19;
  --ink-soft: #4a4a45;
  --muted: #8a877e;
  --line: #e4e0d6;
  --accent: #16314a;       /* deep ink navy */
  --accent-soft: #2f5775;
  --gold: #9c7b3f;         /* restrained bronze accent */
  --maxw: 760px;

  --serif: "Fraunces", "Noto Serif TC", Georgia, "Times New Roman", serif;
  --sans: "Inter", "Noto Sans TC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---- bilingual visibility toggle -------------------------------------- */
.lang-en [data-lang="zh"] { display: none; }
.lang-zh [data-lang="en"] { display: none; }

/* ---- layout ----------------------------------------------------------- */
.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

section {
  padding: 56px 0;
  border-top: 1px solid var(--line);
}

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.section-label {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 20px;
}

p { margin: 0 0 16px; color: var(--ink-soft); }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-soft); text-decoration: underline; text-underline-offset: 3px; }

/* ---- top bar ---------------------------------------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251, 250, 247, 0.86);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.brand {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.nav {
  display: flex;
  align-items: center;
  gap: 22px;
}
.nav a {
  font-size: 14px;
  color: var(--ink-soft);
  font-weight: 500;
}
.nav a:hover { color: var(--accent); text-decoration: none; }
@media (max-width: 680px) {
  .nav .nav-link { display: none; }
}

.lang-toggle {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease;
}
.lang-toggle:hover { border-color: var(--accent); color: var(--accent); }

/* ---- hero ------------------------------------------------------------- */
.hero {
  padding: 76px 0 56px;
  border-top: none;
}
.hero .eyebrow {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 16px;
}
.hero h1 {
  font-size: clamp(38px, 7vw, 60px);
  margin: 0 0 6px;
}
.hero .cn-name {
  font-family: var(--serif);
  font-size: clamp(20px, 4vw, 26px);
  color: var(--muted);
  font-weight: 400;
  margin: 0 0 22px;
}
.hero .role {
  font-size: 19px;
  color: var(--ink);
  font-weight: 600;
  margin: 0 0 18px;
}
.hero .lede {
  font-size: 19px;
  line-height: 1.65;
  color: var(--ink-soft);
  max-width: 62ch;
}

/* ---- contact chips ---------------------------------------------------- */
.contact {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 15px;
  transition: border-color .15s ease, transform .15s ease;
}
.chip:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-1px); }
.chip svg { width: 15px; height: 15px; opacity: .65; }

/* ---- contact icon buttons (consistent round, LINE in brand green) ----- */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--paper-2);
  border: 1px solid var(--line);
  color: var(--accent);
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
.icon-btn:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  text-decoration: none;
}
.icon-btn svg { width: 21px; height: 21px; display: block; }
.icon-btn.line { color: #06c755; }
.icon-btn.line:hover { border-color: #06c755; background: rgba(6, 199, 85, 0.08); }
button.icon-btn { font: inherit; padding: 0; }

/* ---- email chip (text + click to copy) -------------------------------- */
button.chip { font: inherit; }
.email-chip { font-size: 14px; cursor: pointer; }
.email-chip .email-text { font-weight: 500; color: var(--ink); }
.email-chip .copy-hint {
  font-size: 11px;
  color: var(--muted);
  padding-left: 8px;
  margin-left: 2px;
  border-left: 1px solid var(--line);
}
.email-chip.copied { border-color: #06c755; color: #06c755; }
.email-chip.copied .email-text { color: #06c755; }
.email-chip.copied .copy-hint { display: none; }
.email-chip.copied::after { content: "✓"; margin-left: 6px; font-weight: 700; }

/* ---- LINE QR dialog --------------------------------------------------- */
.line-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}
.line-modal[hidden] { display: none; }
.line-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 20, 20, 0.5);
  backdrop-filter: blur(2px);
}
.line-modal-card {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 30px 28px 24px;
  text-align: center;
  max-width: 300px;
  width: calc(100% - 40px);
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.2);
}
.line-modal-close {
  position: absolute;
  top: 8px;
  right: 14px;
  border: none;
  background: none;
  font-size: 26px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
}
.line-modal-close:hover { color: var(--ink); }
.lm-title {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  margin: 0 0 16px;
  color: var(--ink);
}
.lm-qr { width: 190px; height: 190px; display: block; margin: 0 auto 14px; border-radius: 8px; }
.lm-id { font-size: 14px; color: var(--ink-soft); margin: 0 0 16px; }
.lm-id b { color: var(--ink); }
.lm-link {
  display: inline-block;
  background: #06c755;
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  padding: 9px 22px;
  border-radius: 999px;
}
.lm-link:hover { background: #05b34c; color: #fff; text-decoration: none; }

/* ---- highlight stats -------------------------------------------------- */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  margin-top: 10px;
}
.stat {
  background: var(--paper);
  padding: 24px 20px;
}
.stat .num {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 600;
  color: var(--accent);
  line-height: 1.1;
}
.stat .cap {
  font-size: 13.5px;
  color: var(--ink-soft);
  margin-top: 6px;
}
@media (max-width: 640px) {
  .stats { grid-template-columns: 1fr; }
}

/* ---- experience ------------------------------------------------------- */
.job {
  margin-bottom: 34px;
}
.job:last-child { margin-bottom: 0; }
.job-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
}
.job-title {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
  margin: 0;
}
.job-title .org { color: var(--accent); }
.job-date {
  font-size: 13.5px;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.job ul {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}
.job li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 9px;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.62;
}
.job li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 11px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
}
.job li b { color: var(--ink); font-weight: 600; }

/* ---- case study card -------------------------------------------------- */
.card {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 30px 28px;
  margin-top: 8px;
}
.card .case-note {
  font-style: italic;
  color: var(--muted);
  font-size: 15px;
  border-left: 2px solid var(--gold);
  padding-left: 14px;
  margin-bottom: 22px;
}
.case-grid h3 {
  font-size: 16px;
  margin: 18px 0 8px;
}
.case-grid h3:first-child { margin-top: 0; }
.case-grid ul { margin: 0 0 4px; padding-left: 18px; }
.case-grid li { margin-bottom: 6px; color: var(--ink-soft); font-size: 15.5px; }
.case-grid li b { color: var(--ink); }

/* ---- collective / advisors ------------------------------------------- */
.people {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-top: 8px;
}
@media (max-width: 600px) { .people { grid-template-columns: 1fr; } }
.person {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 20px;
  background: var(--paper);
}
.person .pname {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 17px;
}
.person .prole { font-size: 14px; color: var(--gold); font-weight: 600; margin: 2px 0 6px; }
.person .pdesc { font-size: 14.5px; color: var(--ink-soft); margin: 0; }

/* ---- education / references ------------------------------------------- */
.simple-list { margin: 8px 0 0; padding: 0; list-style: none; }
.simple-list li {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
}
.simple-list li:last-child { border-bottom: none; }
.simple-list .li-title { color: var(--ink); font-weight: 600; }

/* ---- footer ----------------------------------------------------------- */
footer {
  border-top: 1px solid var(--line);
  padding: 40px 0 56px;
  text-align: center;
}
footer p { color: var(--muted); font-size: 14px; margin: 0; }
footer .footer-cta {
  font-family: var(--serif);
  font-size: 24px;
  color: var(--ink);
  margin-bottom: 18px;
}

/* ---- reveal animation ------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity .6s ease, transform .6s ease;
  }
  .reveal.in { opacity: 1; transform: none; }
}
