/* Fuxing Island founder setup — tokens follow /DESIGN.md.
   Self-hosted fonts only, no external requests (the site must load inside mainland China). */

@font-face {
  font-family: "Source Serif 4";
  src: url("fonts/source-serif-4-latin-500-normal.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("fonts/source-serif-4-latin-600-normal.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}

:root {
  --bg: #F4F6F7;
  --surface: #FFFFFF;
  --surface-2: #E7ECEF;
  --border: #D3DBE0;
  --text: #16212B;
  --text-muted: #526070;
  --primary: #1F4E6B;
  --primary-hover: #173D54;
  --on-primary: #FFFFFF;
  --accent: #B07F33;
  --success: #2F6B4F;
  --error: #A23B32;
  --ph-bg: #FBEBCF; --ph-text: #5C3B00; --ph-border: #C9963F;
  --footer-bg: #16212B; --footer-text: #E6E9EB; --footer-muted: #A3ADB8;
  --shadow: 0 1px 2px rgba(22,33,43,.06), 0 10px 28px rgba(22,33,43,.08);

  --font-display: "Source Serif 4", "Iowan Old Style", "Palatino Linotype", Georgia, "Songti SC", serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;

  --fs-display: clamp(2.375rem, 5vw, 3.625rem);
  --fs-h2: clamp(1.75rem, 3.2vw, 2.5rem);
  --fs-h3: 1.3125rem;
  --fs-lg: 1.1875rem;
  --fs-body: 1.0625rem;
  --fs-sm: 0.9375rem;
  --fs-xs: 0.8125rem;

  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px;
  --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px;
  --r-sm: 4px; --r-md: 10px;
  --content: 1120px;
  --section-pad: var(--s-9);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #10171E; --surface: #18222C; --surface-2: #1D2933; --border: #2C3A47;
    --text: #E6E9EB; --text-muted: #A3ADB8;
    --primary: #8DBBD6; --primary-hover: #A9CDE2; --on-primary: #0E1A23;
    --accent: #D2A65A; --success: #7CC4A0; --error: #F08A80;
    --ph-bg: #3A2E17; --ph-text: #F2D79E; --ph-border: #8A6A2E;
    --footer-bg: #0B1117; --footer-text: #E6E9EB; --footer-muted: #A3ADB8;
    --shadow: none;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
[id] { scroll-margin-top: calc(84px + env(safe-area-inset-top, 0px)); }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font-body); font-size: var(--fs-body); line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--primary); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--primary-hover); }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; border-radius: 2px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

.wrap { max-width: var(--content); margin: 0 auto; padding: 0 var(--s-5); }
@media (max-width: 400px) { .wrap { padding: 0 var(--s-4); } }

.skip-link {
  position: absolute; left: var(--s-4); top: -100px; z-index: 100;
  background: var(--primary); color: var(--on-primary); padding: var(--s-2) var(--s-4);
  border-radius: var(--r-sm); text-decoration: none; font-weight: 600;
}
.skip-link:focus { top: calc(var(--s-4) + env(safe-area-inset-top, 0px)); color: var(--on-primary); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

h1, h2, h3 { margin: 0; color: var(--text); }
h1 { font-family: var(--font-display); font-weight: 600; font-size: var(--fs-display); line-height: 1.1; letter-spacing: -0.01em; }
h2 { font-family: var(--font-display); font-weight: 600; font-size: var(--fs-h2); line-height: 1.2; letter-spacing: -0.005em; }
h3 { font-family: var(--font-body); font-weight: 600; font-size: 1.125rem; line-height: 1.35; }
.lead { font-size: var(--fs-lg); line-height: 1.6; color: var(--text-muted); max-width: 60ch; }
.eyebrow { font-size: var(--fs-xs); line-height: 1.4; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; color: var(--text-muted); margin: 0 0 var(--s-3); }
.eyebrow.accent { color: var(--accent); }
.rule { width: 56px; height: 2px; background: var(--accent); border: 0; margin: 0 0 var(--s-4); }

/* Placeholder marker: anything not yet known. */
.ph {
  background: var(--ph-bg); color: var(--ph-text); border: 1px dashed var(--ph-border);
  border-radius: 3px; padding: 0 5px; font-size: .92em;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 48px; padding: 0 var(--s-5); border-radius: var(--r-sm);
  font: 600 1rem/1.2 var(--font-body); text-decoration: none; cursor: pointer;
  border: 1px solid transparent; transition: background-color .15s, color .15s, border-color .15s;
}
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-hover); color: var(--on-primary); }
.btn-secondary { background: transparent; color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--surface-2); color: var(--text); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  border-bottom: 1px solid var(--border);
  padding-top: env(safe-area-inset-top, 0px);
}
.nav { display: flex; align-items: center; justify-content: space-between; gap: var(--s-5); min-height: 68px; }
.wordmark { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.wordmark-name { font-family: var(--font-display); font-weight: 600; font-size: 1.3rem; line-height: 1; }
.wordmark-tag {
  font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted);
  border: 1px solid var(--border); border-radius: 999px; padding: 3px 8px; white-space: nowrap;
}
.nav-links { display: flex; align-items: center; gap: 28px; list-style: none; margin: 0; padding: 0; }
.nav-links a:not(.btn) { color: var(--text); text-decoration: none; font-weight: 500; font-size: var(--fs-sm); }
.nav-links a:not(.btn):hover { color: var(--primary); text-decoration: underline; }
.menu-btn {
  display: none; background: none; border: 1px solid var(--border); border-radius: var(--r-sm);
  min-height: 44px; padding: 0 14px; font: 500 var(--fs-sm) var(--font-body); color: var(--text); cursor: pointer;
}

/* Language switch: always visible, sits before the menu button. */
.site-header .wrap.nav { flex-wrap: nowrap; }
.nav-end { display: flex; align-items: center; gap: var(--s-3); order: 3; }
.site-header nav { order: 2; margin-left: auto; }
.lang-switch {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  color: var(--text); text-decoration: none; font-weight: 600; font-size: var(--fs-sm); white-space: nowrap;
}
.lang-switch:hover { background: var(--surface-2); color: var(--text); }

/* Chinese page: Latin glyphs keep the serif, Chinese glyphs use the system sans for clarity. */
html:lang(zh-CN) { --font-display: "Source Serif 4", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif; }
html:lang(zh-CN) h1, html:lang(zh-CN) h2 { letter-spacing: 0; }
html:lang(zh-CN) .eyebrow, html:lang(zh-CN) .wordmark-tag, html:lang(zh-CN) .who-tag { letter-spacing: .04em; }
html:lang(zh-CN) .lead, html:lang(zh-CN) p { line-break: strict; }

/* Sections */
.section { padding: var(--section-pad) 0; }
.section + .section { border-top: 1px solid var(--border); }
.section-band { background: var(--surface-2); }
.section-head { max-width: 720px; margin-bottom: var(--s-7); }
.section-head .lead { margin-top: var(--s-4); margin-bottom: 0; }

/* Hero */
.hero { padding: 80px 0 var(--section-pad); }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center; }
.hero h1 em { font-style: normal; color: var(--primary); }
.hero .lead { margin: var(--s-5) 0 var(--s-6); }
.hero-ctas { display: flex; flex-wrap: wrap; gap: var(--s-3); }
.hero-note { margin: var(--s-5) 0 0; font-size: var(--fs-sm); color: var(--text-muted); }
.map { margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--s-5); box-shadow: var(--shadow); }
.map figcaption { font-size: var(--fs-xs); color: var(--text-muted); margin-top: var(--s-3); }
.map .land { fill: var(--surface-2); stroke: var(--primary); }
.map .water { stroke: var(--primary); }
.map .bridge { stroke: var(--text-muted); }
.map .pin { fill: var(--accent); }
.map .pin-ring { stroke: var(--accent); }
.map text { fill: var(--text-muted); font-family: var(--font-body); font-size: 12px; }
.map text.strong { fill: var(--text); font-weight: 600; }

/* What we set up */
.setup { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 var(--s-7); list-style: none; margin: 0; padding: 0; counter-reset: s; }
.setup li { display: grid; grid-template-columns: 44px 1fr; gap: var(--s-4); padding: 20px 0; border-top: 1px solid var(--border); counter-increment: s; }
.setup li::before { content: counter(s, decimal-leading-zero); font: 600 var(--fs-sm) var(--font-body); color: var(--accent); padding-top: 2px; }
.setup p { margin: var(--s-1) 0 0; color: var(--text-muted); font-size: var(--fs-sm); }

/* How it works */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-5); list-style: none; margin: 0; padding: 0; }
.step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 28px var(--s-5); }
.step .num { font-family: var(--font-display); font-weight: 600; font-size: 2.5rem; line-height: 1; color: var(--accent); margin: var(--s-3) 0 var(--s-5); }
.step p { margin: var(--s-2) 0 0; color: var(--text-muted); }
.who-tag {
  display: inline-block; font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: .08em;
  border-radius: 999px; padding: 2px 10px; background: var(--surface-2); color: var(--text-muted);
}
.step.you .who-tag { background: var(--primary); color: var(--on-primary); }

/* Why the island */
.facts { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 2px solid var(--text); }
.fact { padding: var(--s-5) var(--s-5) var(--s-2) 0; }
.fact + .fact { padding-left: var(--s-5); border-left: 1px solid var(--border); }
.fact .big { font-family: var(--font-display); font-weight: 600; font-size: 2.25rem; line-height: 1.1; margin-bottom: var(--s-2); }
.fact p { margin: 0; color: var(--text-muted); font-size: var(--fs-sm); }
.sources { margin: var(--s-6) 0 0; font-size: var(--fs-sm); color: var(--text-muted); }

/* What's on */
.events { display: grid; grid-template-columns: 1.4fr 1fr; gap: var(--s-5); }
.events > *, .ev-side > * { min-width: 0; }
.ev-side { display: grid; gap: var(--s-5); }
.ev { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--s-5); display: flex; flex-direction: column; }
.ev .art { height: 180px; border-radius: var(--r-sm); background: var(--surface-2); margin-bottom: 20px; display: grid; place-items: center; color: var(--primary); }
.ev.feature .art { height: 260px; }
.ev .photo { display: block; margin: 0 0 20px; border-radius: var(--r-sm); overflow: hidden; background: var(--surface-2); aspect-ratio: 4 / 3; }
.ev .photo img { width: 100%; height: 100%; object-fit: cover; }
.ev .tag { align-self: flex-start; font-size: var(--fs-xs); font-weight: 600; color: var(--text-muted); border: 1px solid var(--border); border-radius: 999px; padding: 2px 10px; margin-bottom: var(--s-3); }
.ev p { color: var(--text-muted); margin: var(--s-2) 0 0; }
.ev .meta { font-size: var(--fs-sm); margin-top: auto; padding-top: var(--s-4); }

/* Who it's for */
.who { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-7); }
.who > div { border-left: 2px solid var(--primary); padding-left: 20px; }
.who p { color: var(--text-muted); margin: var(--s-2) 0 0; }

/* FAQ */
.faq { max-width: 800px; }
.faq details { border-top: 1px solid var(--border); }
.faq details:last-child { border-bottom: 1px solid var(--border); }
.faq summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: var(--s-5); padding: 18px 0; font-weight: 600; font-size: 1.125rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-weight: 400; font-size: 1.5rem; line-height: 1; color: var(--primary); }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { margin: 0 0 20px; color: var(--text-muted); max-width: 66ch; }

/* Contact */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-8); align-items: start; }
.contact-alt { margin-top: var(--s-6); display: grid; gap: var(--s-3); font-size: var(--fs-sm); }
.lead-form { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--s-6); display: grid; gap: 20px; box-shadow: var(--shadow); }
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: var(--fs-sm); }
.field input, .field select, .field textarea {
  font: 400 1rem/1.4 var(--font-body); color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-sm); padding: 12px 14px; width: 100%; min-height: 48px;
}
.field textarea { min-height: 110px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 25%, transparent); }
.field [aria-invalid="true"] { border-color: var(--error); }
.field-error { color: var(--error); font-size: var(--fs-sm); }
.field-error:empty { display: none; }
.form-status { margin: 0; font-size: var(--fs-sm); }
.form-status[data-state="success"] { color: var(--success); }
.form-status[data-state="error"] { color: var(--error); }
.form-status[data-state="info"] { color: var(--text-muted); }

/* Footer */
.site-footer { background: var(--footer-bg); color: var(--footer-text); padding: 56px 0 40px; font-size: var(--fs-sm); }
.site-footer a { color: var(--footer-text); }
.footer-grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-5); }
.footer-name { font-family: var(--font-display); font-weight: 600; font-size: 1.25rem; }
.disclaimer { max-width: 62ch; color: var(--footer-muted); font-size: var(--fs-xs); margin: var(--s-5) 0 0; }

/* Responsive */
@media (max-width: 980px) {
  .facts { grid-template-columns: repeat(2, 1fr); }
  .fact:nth-child(3) { border-left: none; padding-left: 0; }
  .fact:nth-child(n+3) { border-top: 1px solid var(--border); }
  .events { grid-template-columns: 1fr; }
  .ev-side { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .hero-grid, .contact-grid { grid-template-columns: 1fr; gap: 40px; }
  .steps, .who { grid-template-columns: 1fr; }
  .who { gap: 28px; }
}
@media (max-width: 760px) {
  :root { --section-pad: var(--s-8); }
  .menu-btn { display: block; }
  .nav { position: relative; }
  .nav-links {
    display: none; position: absolute; top: 100%; left: calc(-1 * var(--s-5)); right: calc(-1 * var(--s-5));
    flex-direction: column; align-items: stretch; gap: 0; background: var(--bg);
    border-bottom: 1px solid var(--border); padding: var(--s-2) var(--s-5) 20px;
  }
  .nav-links.open { display: flex; }
  .nav-links li a:not(.btn) { display: block; padding: 12px 0; }
  .nav-links .btn { margin-top: var(--s-2); width: 100%; }
  .setup { grid-template-columns: 1fr; }
  .ev-side { grid-template-columns: 1fr; }
  .hero { padding-top: var(--s-7); }
  .lead-form { padding: var(--s-5); }
}
@media (max-width: 480px) {
  .facts { grid-template-columns: 1fr; }
  .fact, .fact + .fact { padding: 20px 0 var(--s-1); border-left: none; }
  .fact + .fact { border-top: 1px solid var(--border); }
  .wordmark-tag { display: none; }
}
