/* Fairmol Limited — editorial style on a grass-green page, light only.
   Newsreader (headings), Archivo (text), IBM Plex Mono (labels);
   Chinese headings in LXGW WenKai. */

/* ---------- Fonts (self-hosted, latin subset) ---------- */

@font-face {
  font-family: "Newsreader";
  src: url("../fonts/newsreader-normal-400-600.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("../fonts/newsreader-italic-400-600.woff2") format("woff2");
  font-weight: 400 600;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo-normal-400-700.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/ibm-plex-mono-normal-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/ibm-plex-mono-normal-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* Chinese headings: LXGW WenKai (OFL, licence in ../fonts/LXGWWenKai-OFL.txt),
   cut down to the characters the site uses. tools/subset-zh.py makes the file
   and rewrites this URL on every publish. */
@font-face {
  font-family: "Fairmol Kai";
  src: url("../fonts/lxgw-wenkai-3d2262d2.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

/* For the Chinese page: same files, minus the dash, middle dot, curly quotes
   and ellipsis, so Chinese punctuation is drawn by the Chinese system font. */
@font-face {
  font-family: "Newsreader Zh";
  src: url("../fonts/newsreader-normal-400-600.woff2") format("woff2");
  font-weight: 400 600;
  font-display: swap;
  unicode-range: U+0000-00B6, U+00B8-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-2013, U+2015-2017, U+201E-2025, U+2027-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Archivo Zh";
  src: url("../fonts/archivo-normal-400-700.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
  unicode-range: U+0000-00B6, U+00B8-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-2013, U+2015-2017, U+201E-2025, U+2027-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Colours ---------- */

:root {
  --bg: #d3ecd9;
  --bg-raised: #eef8f0;
  --ink: #15211b;
  --ink-soft: #43534a;
  --line: #b2d5bb;
  --green: #26744c;
  --green-deep: #1d5c3c;
  --green-tint: #bfe2c8;
  --grass: #5fae7f;
  --grass-hover: #529f71;
  --grass-ink: #0c2e1f;
  --grass-text: #3f8c5f;
  --amber: #3f8c5f;
  --amber-tint: #bfe2c8;
  --on-green: #ffffff;
  --error: #a8402e;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

/* ---------- Base ---------- */

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--green); }
button { font: inherit; color: inherit; }
::selection { background: var(--amber-tint); color: var(--ink); }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; border-radius: 4px; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 8px 14px;
  border-radius: 6px;
  background: var(--green);
  color: var(--on-green);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

.mono { font-family: var(--mono); }

/* ---------- Top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  padding-top: 14px;
  padding-bottom: 14px;
  flex-wrap: wrap;
}
.wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1;
  color: var(--ink);
  text-decoration: none;
}
.wordmark .dot { color: var(--amber); }
.wordmark small {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.topbar-end { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; }
nav.main { display: flex; gap: 4px; flex-wrap: wrap; }
nav.main a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 0.2s, background-color 0.2s;
}
nav.main a:hover,
nav.main a[aria-current="true"] { color: var(--ink); background: var(--green-tint); }

.lang {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
}
.lang > * {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--ink-soft);
  text-decoration: none;
}
.lang a:hover { color: var(--ink); background: var(--green-tint); }
.lang [aria-current] { color: var(--green-deep); background: var(--green-tint); font-weight: 500; }

/* ---------- Hero ---------- */

.hero { padding: 64px 0 56px; border-bottom: 1px solid var(--line); }
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 48px;
  align-items: center;
}
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--green-tint);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--green-deep);
}
.status-chip::before {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber);
}
h1 {
  margin: 22px 0 20px;
  font-family: var(--serif);
  font-size: clamp(38px, 5.2vw, 58px);
  line-height: 1.08;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
h1 em { font-style: italic; color: var(--grass-text); }
.lede { max-width: 34em; margin: 0 0 28px; font-size: 19px; color: var(--ink-soft); }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 22px;
  border: 1px solid var(--green);
  border-radius: 8px;
  font-size: 15.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}
.btn-solid { background: var(--grass); border-color: var(--grass); color: var(--grass-ink); }
.btn-solid:hover { background: var(--grass-hover); border-color: var(--grass-hover); }
.btn-ghost { background: transparent; color: var(--green); }
.btn-ghost:hover { background: var(--green-tint); }

figure.hero-art { margin: 0; }
.hero-art img { width: 100%; border: 1px solid var(--line); border-radius: 10px; }
.hero-art figcaption {
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
}

/* ---------- Sections ---------- */

section.block { padding: 64px 0; border-bottom: 1px solid var(--line); }
section.block--tint { background: var(--green-tint); }
.sec-head { display: flex; align-items: baseline; gap: 16px; margin-bottom: 34px; }
.sec-no {
  flex: none;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.1em;
  color: var(--amber);
}
h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(28px, 3.4vw, 38px);
  font-weight: 500;
  line-height: 1.15;
  text-wrap: balance;
}
.sec-intro { max-width: 40em; margin: -18px 0 30px; color: var(--ink-soft); }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.two-col p { margin: 0 0 16px; color: var(--ink-soft); }
.two-col p:last-child { margin-bottom: 0; }
.two-col p strong { color: var(--ink); font-weight: 600; }
.pull {
  margin: 0;
  font-family: var(--serif);
  font-size: 23px;
  line-height: 1.4;
  color: var(--ink);
}
.two-col .pull { color: var(--ink); }
.pull em { color: var(--green); }

/* What we do: numbered rows */
.focus-row {
  display: grid;
  grid-template-columns: 64px 1fr 1.4fr;
  gap: 24px;
  align-items: start;
  padding: 26px 0;
  border-top: 1px solid var(--line);
}
.focus-row:last-child { border-bottom: 1px solid var(--line); }
.focus-row .idx { padding-top: 4px; font-family: var(--mono); font-size: 14px; color: var(--amber); }
.focus-row h3 { margin: 0; font-family: var(--serif); font-size: 22px; font-weight: 600; line-height: 1.25; }
.focus-row p { margin: 0; font-size: 16px; color: var(--ink-soft); }

/* Our model: principles */
.principles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 48px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.principles li { position: relative; padding: 22px 0 22px 34px; border-top: 1px solid var(--line); }
.principles li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 30px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--grass-text);
}
.principles h3 { margin: 0 0 6px; font-size: 17px; font-weight: 700; }
.principles p { margin: 0; font-size: 15.5px; color: var(--ink-soft); }

/* Vision */
.vision-text {
  max-width: 28em;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(26px, 3.1vw, 36px);
  line-height: 1.3;
  font-weight: 400;
  color: var(--ink);
  text-wrap: pretty;
}
.vision-text em { font-style: italic; color: var(--grass-text); }

/* About: facts */
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 0 48px; margin: 0; }
.fact { padding: 18px 0; border-top: 1px solid var(--line); }
.fact dt {
  margin-bottom: 6px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.fact dd { margin: 0; font-size: 16.5px; font-weight: 500; }
.fact dd.num { font-variant-numeric: tabular-nums; letter-spacing: 0.04em; }
.fact dd span { display: block; letter-spacing: normal; margin-top: 3px; font-size: 14.5px; font-weight: 400; color: var(--ink-soft); }

/* ---------- Contact ---------- */

.contact-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 48px; align-items: start; }
.contact-intro { margin: 0 0 24px; color: var(--ink-soft); }
.mail-row { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; }
.mail-link {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--amber);
  text-decoration-thickness: 1px;
  text-underline-offset: 6px;
  overflow-wrap: anywhere;
}
.mail-link:hover { color: var(--green); }
.copy-btn {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-raised);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background-color 0.2s;
}
.copy-btn:hover,
.copy-btn.is-done { color: var(--green-deep); border-color: var(--green); background: var(--green-tint); }
.contact-office { margin: 30px 0 0; padding-top: 18px; border-top: 1px solid var(--line); }
.contact-office dt {
  margin-bottom: 6px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.contact-office dd { margin: 0; font-weight: 500; }

.form-panel {
  padding: 26px 28px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-raised);
}
.field-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 16px; }
.field { margin-bottom: 18px; }
.field label { display: block; margin-bottom: 6px; font-size: 14.5px; font-weight: 600; }
.field label span { color: var(--amber); }
.field input,
.field textarea {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  line-height: 1.5;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field textarea { min-height: 128px; resize: vertical; }
.field input::placeholder,
.field textarea::placeholder { color: var(--ink-soft); opacity: 0.7; }
.field input:focus,
.field textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-tint); }
.field.has-error input,
.field.has-error textarea { border-color: var(--error); }
.field-error { display: block; margin-top: 6px; font-size: 14px; color: var(--error); }
.field-error:empty { display: none; }
.form-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; margin-top: 6px; }
.form-note { margin: 0; font-family: var(--mono); font-size: 12px; color: var(--ink-soft); }

.form-success { outline: none; }
.form-success h3 { margin: 0 0 10px; font-family: var(--serif); font-size: 26px; font-weight: 500; }
.form-success p { margin: 0 0 22px; color: var(--ink-soft); }
.success-mark {
  display: inline-block;
  margin-bottom: 14px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--green-tint);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--green-deep);
}
.success-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- Footer ---------- */

footer { padding: 48px 0 56px; }
.foot-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px 48px; align-items: start; }
footer .wordmark { font-size: 22px; }
footer p { max-width: 38em; margin: 10px 0 0; font-size: 14.5px; color: var(--ink-soft); }
.foot-note {
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.9;
  text-align: right;
  color: var(--ink-soft);
}
.foot-note a { display: inline-block; min-height: 32px; padding: 4px 0; text-decoration: none; }
.foot-note a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Scroll reveal (only when JS runs) ---------- */

.js .reveal { opacity: 0; transform: translateY(12px); transition: opacity 0.6s ease, transform 0.6s ease; }
.js .reveal.is-in { opacity: 1; transform: none; }

/* ---------- 404 ---------- */

.notfound { min-height: 100vh; min-height: 100svh; display: grid; place-items: center; padding: 64px 0; text-align: center; }
.notfound h1 { margin: 26px 0 12px; }
.notfound p { margin: 0 0 26px; color: var(--ink-soft); }
.notfound .hero-actions { justify-content: center; }

/* ---------- Chinese page ---------- */

body:lang(zh) {
  --serif: "Newsreader Zh", "Fairmol Kai", "Kaiti SC", "STKaiti", "KaiTi", "Songti SC", "STSong", "Noto Serif SC", "PingFang SC", "Microsoft YaHei", serif;
  --sans: "Archivo Zh", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Noto Sans CJK SC", system-ui, sans-serif;
  --mono: "IBM Plex Mono", "PingFang SC", "Microsoft YaHei", ui-monospace, monospace;
  line-height: 1.8;
  font-synthesis: none; /* WenKai has one weight: never fake bold or slant it */
}
body:lang(zh) .wordmark { font-family: "Newsreader", Georgia, serif; }
.lang a[lang|="zh"] { font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif; }
body:lang(zh) h1 { line-height: 1.25; letter-spacing: 0.01em; }
body:lang(zh) h2 { line-height: 1.3; letter-spacing: 0.01em; }
body:lang(zh) em { font-style: normal; }
body:lang(zh) .pull { line-height: 1.6; }
body:lang(zh) .vision-text { line-height: 1.55; letter-spacing: 0.01em; }
body:lang(zh) .status-chip,
body:lang(zh) .fact dt,
body:lang(zh) .contact-office dt { letter-spacing: 0.08em; }
body:lang(zh) .lede,
body:lang(zh) .focus-row p,
body:lang(zh) .principles p { text-wrap: pretty; }
.clause { display: inline-block; }
.nw { white-space: nowrap; }

/* ---------- Responsive ---------- */

@media (max-width: 820px) {
  html { scroll-padding-top: 0; }
  .topbar { position: static; }
  .hero { padding: 44px 0 40px; }
  .hero-grid { grid-template-columns: 1fr; gap: 32px; }
  section.block { padding: 48px 0; }
  .two-col, .principles, .facts, .contact-grid { grid-template-columns: 1fr; }
  .contact-grid { gap: 32px; }
  .focus-row { grid-template-columns: 40px 1fr; }
  .focus-row p { grid-column: 2; }
  .foot-grid { grid-template-columns: minmax(0, 1fr); }
  .foot-note { text-align: left; }
}
@media (max-width: 560px) {
  .wrap { padding: 0 20px; }
  .topbar-inner { padding-top: 12px; padding-bottom: 10px; }
  .topbar-end { display: contents; }
  .lang { margin-left: auto; }
  nav.main { order: 3; flex: 1 0 100%; flex-wrap: nowrap; overflow-x: auto; margin: 0 -20px; padding: 0 12px; scrollbar-width: none; }
  nav.main::-webkit-scrollbar { display: none; }
  nav.main a { flex: none; padding: 8px 10px; }
  nav.main { -webkit-mask-image: linear-gradient(90deg, #000 82%, transparent); mask-image: linear-gradient(90deg, #000 82%, transparent); }
  .status-chip { font-size: 10.5px; letter-spacing: 0.02em; border-radius: 14px; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .form-panel { padding: 22px 18px; }
  .form-foot .btn { width: 100%; }
  .mail-link { font-size: 21px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
}

.copy-buffer { position: fixed; top: 0; left: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
