/* Self-hosted subset variable fonts (built with pyftsubset from Google Fonts variable TTFs).
   Family names match the Google Fonts originals so var(--sans/--serif/--mono) need no change.
   font-weight is a range = the variable wght axis; only weights the CSS uses are exercised. */
@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url('/assets/fonts/inter.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url('/assets/fonts/jbm.woff2') format('woff2');
}
@font-face {
  font-family: 'Source Serif 4'; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url('/assets/fonts/serif.woff2') format('woff2');
}
@font-face {
  font-family: 'Noto Sans TC'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url('/assets/fonts/noto-tc.woff2') format('woff2');
}

:root {
  /* light, research / academic palette */
  --bg: #f3f6fa;
  --bg-tint: #eaf0f7;
  --panel: #ffffff;
  --panel-2: #eef2f8;
  --line: #e0e7f0;
  --line-2: #cbd5e3;
  --txt: #14202f;
  --txt-dim: #4d5d74;
  --txt-faint: #586679;   /* WCAG AA: ~5.4:1 on --bg (was #8493a7 ≈ 2.9:1) */
  --accent: #0e9e84;       /* teal — primary */
  --accent-d: #0a7866;     /* darker teal for text on light */
  --accent-2: #2563c9;     /* blue */
  --amber: #c9821b;
  --red: #d24359;
  --grid: rgba(37,99,201,0.055);

  /* dark "instrument" surfaces for the radar scopes */
  --scope-bg: #080c12;
  --scope-panel: #0c1119;

  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --serif: 'Source Serif 4', Georgia, serif;
  --sans: 'Inter', 'Noto Sans TC', system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--txt);
  font-family: var(--sans);
  line-height: 1.62;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
body.zh { font-family: 'Noto Sans TC', 'Inter', system-ui, sans-serif; }
a { color: inherit; text-decoration: none; }
em { color: var(--accent-d); font-style: normal; font-weight: 600; }
strong { color: var(--txt); font-weight: 700; }

/* keyboard focus ring (only for keyboard users, not mouse clicks) */
:focus-visible { outline: 2px solid var(--accent-d); outline-offset: 2px; }

/* skip-to-content link — off-screen until focused */
.skip-link {
  position: absolute; left: 12px; top: -56px; z-index: 100;
  background: var(--accent); color: #fff; padding: 9px 16px; border-radius: 8px;
  font-size: 14px; font-weight: 600; transition: top .15s;
}
.skip-link:focus { top: 12px; }

/* ===== nicer line wrapping (gracefully ignored on older browsers) =====
   balance: even out multi-line headings; pretty: avoid orphan last lines in body */
.hero-title, .section-head h2, .contact h2, .big-q,
.ld-title, .hypo h3, .icard h3, .rcard-h, .layer-name, .stat-n {
  text-wrap: balance;
}
.hero-sub, .section-lead, .rcard p, .research-invite, .hypo p,
.icard-ask, .about-bio p, .contact p, .invite-foot p, .ld-note,
.layer-tw, .stat-l, .hero-tag {
  text-wrap: pretty;
}

/* ===== backdrop: faint blueprint grid ===== */
.backdrop {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 46px 46px,
    linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 46px 46px,
    radial-gradient(ellipse at 50% -8%, rgba(14,158,132,0.10), transparent 55%),
    var(--bg);
}

/* ===== nav ===== */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 32px;
  background: rgba(243,246,250,0.82); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-weight: 700; letter-spacing: .03em; color: var(--txt); }
.brand-mark { color: var(--accent); font-size: 15px; }
.brand-sub { color: var(--txt-faint); font-weight: 500; }
.nav-links { display: flex; gap: 26px; font-size: 13.5px; color: var(--txt-dim); }
.nav-links a { transition: color .15s; position: relative; padding-bottom: 3px; }
.nav-links a:hover { color: var(--accent-d); }
.nav-links a.active { color: var(--accent-d); font-weight: 600; }
.nav-links a.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: var(--accent); border-radius: 2px;
}

/* ===== tabbed pages ===== */
.page { display: none; }
.page.active { display: block; animation: pageIn .34s ease both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* home quick-jump row */
.home-jump { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 18px; margin-top: 48px; font-size: 14px; }
.home-jump-l { font-family: var(--mono); font-size: 12.5px; color: var(--txt-faint); letter-spacing: .04em; }
.home-jump a { color: var(--accent-d); font-weight: 600; border-bottom: 1px solid transparent; transition: border-color .15s; }
.home-jump a:hover { border-color: var(--accent); }
.nav-right { display: flex; align-items: center; gap: 16px; }
.lang-toggle {
  font-family: var(--mono); font-size: 12.5px; background: transparent;
  border: 1px solid var(--line-2); color: var(--txt-dim); border-radius: 6px;
  padding: 5px 9px; cursor: pointer; transition: all .15s;
}
.lang-toggle:hover { border-color: var(--accent); color: var(--accent-d); }
.lang-toggle .lang-sep { color: var(--txt-faint); margin: 0 2px; }
body:not(.zh) .lang-toggle .lang-en { color: var(--accent-d); font-weight: 600; }
body.zh .lang-toggle .lang-zh { color: var(--accent-d); font-weight: 600; }

/* mobile hamburger — hidden on desktop, shown ≤940px (see media query) */
.nav-toggle { display: none; }

/* ===== hero ===== */
.hero { max-width: 1000px; margin: 0 auto; padding: 92px 32px 72px; text-align: center; }
.hero-tag {
  display: inline-block; font-family: var(--mono); font-size: 12.5px; letter-spacing: .04em;
  color: var(--accent-d); border: 1px solid rgba(14,158,132,0.35); border-radius: 100px;
  padding: 6px 16px; margin-bottom: 30px; background: rgba(14,158,132,0.07);
}
.hero-title { font-size: clamp(33px, 5.6vw, 58px); font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; }
.hero-title .accent {
  background: linear-gradient(115deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-sub { max-width: 700px; margin: 26px auto 0; font-size: 18px; color: var(--txt-dim); font-family: var(--serif); line-height: 1.7; }
.hero-cta { display: flex; gap: 14px; justify-content: center; margin-top: 36px; flex-wrap: wrap; }
.btn {
  font-size: 15px; font-weight: 600; padding: 13px 24px; border-radius: 9px;
  transition: transform .15s, box-shadow .15s, background .15s, border-color .15s, color .15s; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px; border: 1px solid transparent;
}
.btn-primary { background: var(--accent-d); color: #fff; }  /* --accent-d: white contrast 5.4:1 (WCAG AA); --accent #0e9e84 was 3.36:1 */
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(14,158,132,0.3); }
.btn-ghost { border-color: var(--accent); color: var(--accent-d); background: rgba(14,158,132,0.09); }
.btn-ghost:hover { border-color: var(--accent-d); background: rgba(14,158,132,0.16); }
.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; max-width: 800px; margin: 54px auto 0; }
.hero-stats > div { border: 1px solid var(--line); border-radius: 12px; padding: 18px 16px; background: #fff; text-align: left; box-shadow: 0 1px 2px rgba(20,32,47,0.03); }
.stat-n { display: block; font-family: var(--mono); font-weight: 600; color: var(--accent-d); font-size: 15px; }
.stat-l { display: block; font-size: 13px; color: var(--txt-dim); margin-top: 5px; }

/* ===== sections ===== */
.section { max-width: 1140px; margin: 0 auto; padding: 78px 32px; }
.section.alt { max-width: none; background: var(--bg-tint); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section.alt > * { max-width: 1140px; margin-left: auto; margin-right: auto; }
.section-head { max-width: 760px; margin-bottom: 40px; }
.kicker { font-family: var(--mono); font-size: 12.5px; letter-spacing: .09em; color: var(--accent-d); display: inline-flex; align-items: center; gap: 13px; }
.kicker::before { content: ""; width: 26px; height: 2px; background: var(--accent); border-radius: 2px; flex: none; }
.section-head h2 { font-size: clamp(25px, 3.4vw, 36px); font-weight: 700; letter-spacing: -0.01em; margin: 12px 0 14px; }
.section-lead { font-size: 17px; color: var(--txt-dim); font-family: var(--serif); line-height: 1.7; }

/* ===== research section ===== */
.big-q {
  font-family: var(--serif); font-size: clamp(21px, 2.8vw, 30px); line-height: 1.45; font-weight: 600;
  color: var(--txt); max-width: 920px; border-left: 4px solid var(--accent); padding: 6px 0 6px 26px; margin: 0 0 44px;
}
.research-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.rcard { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 24px; box-shadow: 0 1px 2px rgba(20,32,47,0.03); }
.rcard-h { font-family: var(--mono); font-size: 12.5px; letter-spacing: .03em; color: var(--accent-d); text-transform: uppercase; margin-bottom: 12px; }
.rcard p { font-size: 14.5px; color: var(--txt-dim); }
.research-invite {
  margin-top: 36px; font-family: var(--serif); font-size: 18px; line-height: 1.7; color: var(--txt);
  background: linear-gradient(180deg, rgba(14,158,132,0.06), rgba(37,99,201,0.04));
  border: 1px solid rgba(14,158,132,0.2); border-radius: 14px; padding: 24px 28px; max-width: 920px;
}

/* ===== framework ===== */
.framework { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 26px; align-items: start; }
.layers { display: flex; flex-direction: column; gap: 10px; }
.layer {
  display: grid; grid-template-columns: 50px 1fr auto; align-items: center; gap: 14px;
  padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; background: #fff;
  cursor: pointer; transition: all .18s; box-shadow: 0 1px 2px rgba(20,32,47,0.03);
}
.layer:hover { border-color: var(--line-2); transform: translateX(3px); }
.layer.active { border-color: var(--accent); background: #fff; box-shadow: 0 0 0 1px var(--accent), 0 10px 26px rgba(14,158,132,0.14); }
.layer-id { font-family: var(--mono); font-weight: 700; font-size: 19px; color: var(--accent-2); }
.layer.gap-edge { border-style: dashed; border-color: var(--amber); }
.layer-name { font-weight: 600; font-size: 15px; }
.layer-tw { font-size: 12.5px; color: var(--txt-dim); margin-top: 2px; }
.layer-badge { font-family: var(--mono); font-size: 10.5px; padding: 4px 9px; border-radius: 100px; white-space: nowrap; }
.b-world { background: rgba(14,158,132,0.13); color: var(--accent-d); }
.b-tier1 { background: rgba(37,99,201,0.12); color: var(--accent-2); }
.b-small { background: rgba(201,130,27,0.15); color: var(--amber); }
.b-zero { background: rgba(210,67,89,0.13); color: var(--red); }
.gap-marker { text-align: center; font-family: var(--mono); font-size: 11.5px; color: var(--amber); padding: 3px 0; }
.gap-marker span { border: 1px dashed var(--amber); border-radius: 100px; padding: 4px 14px; background: rgba(201,130,27,0.07); }

.layer-detail { position: sticky; top: 88px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 24px; min-height: 320px; box-shadow: 0 2px 8px rgba(20,32,47,0.05); }
.ld-id { font-family: var(--mono); font-size: 13px; color: var(--accent-2); letter-spacing: .06em; }
.ld-title { font-size: 21px; font-weight: 700; margin: 6px 0 4px; }
.ld-status { display: inline-block; font-family: var(--mono); font-size: 12px; padding: 4px 11px; border-radius: 100px; margin-bottom: 18px; }
.ld-block { margin-bottom: 16px; }
.ld-block h4 { font-family: var(--mono); font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--txt-faint); margin-bottom: 8px; }
.ld-players { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { font-size: 12.5px; padding: 5px 11px; border-radius: 7px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--txt-dim); }
.chip.tw { border-color: rgba(14,158,132,0.4); color: var(--accent-d); background: rgba(14,158,132,0.06); }
.ld-note { font-size: 14px; color: var(--txt-dim); border-left: 2px solid var(--accent); padding-left: 13px; font-family: var(--serif); }

/* ===== hypotheses ===== */
.hypos { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.hypo { border: 1px solid var(--line); border-radius: 14px; padding: 24px; background: #fff; transition: all .18s; box-shadow: 0 1px 2px rgba(20,32,47,0.03); }
.hypo:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: 0 10px 24px rgba(14,158,132,0.12); }
.hypo-id { font-family: var(--mono); font-size: 36px; font-weight: 700; color: var(--accent); opacity: .25; line-height: 1; }
.hypo h3 { font-size: 17px; font-weight: 600; margin: 8px 0 10px; }
.hypo p { font-size: 14px; color: var(--txt-dim); }
.hypo .hypo-meta { font-family: var(--mono); font-size: 12px; color: var(--txt-faint); margin-top: 14px; display: flex; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 12px; }
.hypo .hypo-meta b { color: var(--accent-2); }

/* ===== radar app (dark instrument inside light page) ===== */
.radar-app {
  display: grid; grid-template-columns: 300px 1fr; gap: 20px;
  background: var(--scope-panel); border: 1px solid #1b2532; border-radius: 16px; padding: 20px;
  box-shadow: 0 14px 40px rgba(8,12,18,0.28);
}
.radar-controls { display: flex; flex-direction: column; gap: 16px; }
/* small "this maps to what I do" labels on the demo (dark instrument panel -> light teal pill) */
.demo-tag { align-self: flex-start; font-family: var(--mono); font-size: 11px; letter-spacing: .04em;
  color: #38e1b0; background: rgba(56,225,176,0.1); border: 1px solid rgba(56,225,176,0.28);
  border-radius: 100px; padding: 5px 12px; }
.stage-cell { display: flex; flex-direction: column; gap: 16px; }
.demo-hw-note { font-family: var(--mono); font-size: 11px; line-height: 1.65; color: #6b7a8d;
  padding-top: 14px; border-top: 1px solid #1b2532; }
.ctrl-group { background: var(--scope-bg); border: 1px solid #1b2532; border-radius: 11px; padding: 15px; }
.ctrl-title { font-family: var(--mono); font-size: 12px; letter-spacing: .05em; color: #5ad1ff; text-transform: uppercase; margin-bottom: 13px; }
.ctrl { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 10px; margin-bottom: 13px; font-size: 13px; color: #9fb0c4; }
.ctrl:last-child { margin-bottom: 0; }
.ctrl .val { font-family: var(--mono); color: #38e1b0; font-size: 12.5px; }
.ctrl input[type=range] { grid-column: 1 / -1; width: 100%; }
.ctrl-note { font-size: 12px; color: #6b7a8d; font-family: var(--mono); margin-top: 4px; }
.ctrl-note strong { color: #ffb454; }
.ctrl-check { display: flex; align-items: center; gap: 9px; font-size: 13px; color: #9fb0c4; margin-bottom: 11px; cursor: pointer; }
.ctrl-check:last-child { margin-bottom: 0; }
.ctrl-check input { accent-color: #38e1b0; width: 15px; height: 15px; }

/* "ⓘ" info badges on radar controls + their hover/focus tooltip (plain-language term help) */
.ctrl-name { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.tip { display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 14px; height: 14px; border-radius: 50%; border: 1px solid #3a4a5e; color: #7c8ba0;
  font-family: var(--mono); font-size: 9px; font-style: italic; line-height: 1; cursor: help;
  position: relative; user-select: none; }
.tip:hover, .tip:focus-visible { color: #38e1b0; border-color: #38e1b0; outline: none; }
.tip:hover::after, .tip:focus::after {
  content: attr(data-tiptext);
  position: absolute; bottom: calc(100% + 8px); left: -2px;
  width: max-content; max-width: 230px; white-space: normal; text-align: left;
  background: #0c1119; color: #cdd8e6; border: 1px solid #2a3a4e; border-radius: 8px;
  padding: 8px 10px; font-family: var(--sans); font-style: normal; font-size: 11.5px; line-height: 1.5;
  box-shadow: 0 10px 28px rgba(0,0,0,0.5); z-index: 60; pointer-events: none; }
/* target-type dropdown */
.ctrl-select { margin-bottom: 13px; }
.ctrl-select .ctrl-name { font-size: 13px; color: #9fb0c4; margin-bottom: 7px; }
.ctrl-sel { width: 100%; font-family: var(--mono); font-size: 12.5px; color: #cdd8e6;
  background: #0c1119; border: 1px solid #243042; border-radius: 7px; padding: 7px 9px; cursor: pointer; }
.ctrl-sel:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

input[type=range] { -webkit-appearance: none; appearance: none; height: 4px; background: #243042; border-radius: 3px; outline: none; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 15px; height: 15px; border-radius: 50%; background: #38e1b0; cursor: pointer; box-shadow: 0 0 8px rgba(56,225,176,0.5); }
input[type=range]::-moz-range-thumb { width: 15px; height: 15px; border: none; border-radius: 50%; background: #38e1b0; cursor: pointer; }

.mini-btn { font-family: var(--mono); font-size: 12px; padding: 8px 12px; width: 100%; margin-top: 9px; border-radius: 7px; border: 1px solid #243042; background: rgba(56,225,176,0.1); color: #38e1b0; cursor: pointer; transition: all .15s; }
.mini-btn:hover { background: rgba(56,225,176,0.2); }
.mini-btn.ghost { background: transparent; color: #9fb0c4; }
.mini-btn.ghost:hover { color: #ff5e6c; border-color: #ff5e6c; }

.radar-readout { font-family: var(--mono); font-size: 11.5px; line-height: 1.7; color: #9fb0c4; background: var(--scope-bg); border: 1px solid #1b2532; border-radius: 9px; padding: 12px; min-height: 196px; }
.radar-readout .rk { color: #6b7a8d; }
.radar-readout .rv { color: #38e1b0; }
.radar-readout .rd-hit { color: #ffb454; }

.radar-stage { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.scope-col { display: flex; flex-direction: column; gap: 16px; }
.scope-wrap { position: relative; background: var(--scope-bg); border: 1px solid #1b2532; border-radius: 12px; padding: 12px; }
.scope-label { font-family: var(--mono); font-size: 11px; letter-spacing: .06em; color: #6b7a8d; text-transform: uppercase; margin-bottom: 8px; }
.scope-wrap canvas { width: 100%; height: auto; display: block; }


/* plain-language helper for non-radar visitors */
.demo-hint {
  max-width: 820px; margin: -8px 0 14px; font-size: 14.5px; color: var(--txt-dim);
  font-family: var(--serif); line-height: 1.6;
  border-left: 3px solid var(--accent); padding: 5px 0 5px 15px;
}
.demo-play {  /* one-line "how to play" callout above the demo */
  max-width: 820px; margin: 0 0 24px; font-size: 14.5px; color: var(--txt-dim);
  font-family: var(--serif); line-height: 1.6;
  background: rgba(14,158,132,0.06); border: 1px solid var(--line); border-radius: 10px; padding: 11px 16px;
}
.demo-play strong { color: var(--accent-d); }

/* ===== invite ===== */
.invite-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.icard { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 22px; transition: all .18s; box-shadow: 0 1px 2px rgba(20,32,47,0.03); }
.icard:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: 0 10px 24px rgba(14,158,132,0.12); }
.icard-tag { font-family: var(--mono); font-size: 11px; letter-spacing: .04em; color: var(--accent-d); text-transform: uppercase; }
.icard h3 { font-size: 16.5px; font-weight: 700; margin: 7px 0 9px; }
.icard .icard-ask { font-size: 14px; color: var(--txt-dim); }
.icard .icard-ask b { color: var(--txt); font-weight: 600; }
.invite-foot { margin-top: 34px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.invite-foot p { font-family: var(--serif); font-size: 17px; color: var(--txt-dim); max-width: 640px; }

/* ===== about ===== */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; }
/* headshot: circular, with a CSS initials avatar as fallback behind the <img> */
.headshot {
  position: relative; width: 132px; height: 132px; border-radius: 50%; overflow: hidden;
  margin: 0 0 24px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 20px rgba(14,158,132,0.22);
}
.headshot-initials { font-family: var(--mono); font-weight: 700; font-size: 44px; color: #fff; letter-spacing: .04em; }
.headshot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.about-bio p { font-size: 16.5px; color: var(--txt-dim); margin-bottom: 18px; font-family: var(--serif); line-height: 1.72; }

/* quick facts (left column, under bio) */
.about-facts { list-style: none; display: flex; flex-direction: column; gap: 11px; margin-top: 26px; }
.about-facts li { display: grid; grid-template-columns: 96px 1fr; gap: 14px; font-size: 13.5px; color: var(--txt-dim); border-top: 1px solid var(--line); padding-top: 11px; }
.about-facts .fk { font-family: var(--mono); font-size: 11.5px; color: var(--accent-d); text-transform: uppercase; letter-spacing: .03em; }

/* right rail: built / honors lists */
.about-rail { display: flex; flex-direction: column; gap: 30px; }
.about-block h3 { font-family: var(--mono); font-size: 12.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--accent-d); margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.about-list { list-style: none; display: flex; flex-direction: column; gap: 15px; }
.about-list li { display: block; }
.about-list.honors li { display: grid; grid-template-columns: 24px 1fr; gap: 11px; align-items: start; }
.al-ic { font-size: 16px; line-height: 1.4; }
.al-t { display: block; font-weight: 600; font-size: 15px; color: var(--txt); }
/* filled pill links — accent-d gives white text a 5.4:1 ratio (WCAG AA) */
.al-link { display: inline-block; margin-top: 9px; font-family: var(--mono); font-size: 11.5px;
  color: #fff; background: var(--accent-d); border: 1px solid var(--accent-d);
  border-radius: 100px; padding: 5px 13px; transition: all .15s; }
.al-link:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(10,120,102,0.32); }
/* LinkedIn / Email pill links in the About bio */
.about-links { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.about-link { font-family: var(--mono); font-size: 12.5px; color: #fff; background: var(--accent-d);
  border: 1px solid var(--accent-d); border-radius: 100px; padding: 8px 16px; transition: all .15s; }
.about-link:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(10,120,102,0.32); }
.al-d { display: block; font-size: 13.5px; color: var(--txt-dim); margin-top: 3px; line-height: 1.55; }

/* ===== contact ===== */
.contact { max-width: 760px; margin: 0 auto; padding: 40px 32px 72px; text-align: center; }
.contact h2 { font-size: clamp(24px, 3.2vw, 33px); font-weight: 700; letter-spacing: -0.01em; }
.contact p { color: var(--txt-dim); margin-top: 14px; font-size: 17px; font-family: var(--serif); }
.contact-cta { display: flex; gap: 14px; justify-content: center; margin: 32px 0; flex-wrap: wrap; }
.invite-cta-note { text-align: center; color: var(--txt-dim); font-family: var(--serif); font-size: 15px; margin: 2px 0 12px; }
.invite-cta-top { margin: 0 0 36px; }   /* contact row surfaced at top of Coffee Chat page */
.contact-foot { font-family: var(--mono); font-size: 12.5px; color: var(--txt-faint); display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ===== lang visibility ===== */
.lang-zh-only { display: none; }
body.zh .lang-en-only { display: none; }
body.zh .lang-zh-only { display: inline; }

/* ===== responsive ===== */
@media (max-width: 940px) {
  /* hamburger visible; nav becomes a dropdown panel under the bar */
  .nav-toggle {
    display: inline-flex; flex-direction: column; justify-content: center; gap: 4px;
    width: 40px; height: 34px; padding: 8px; background: transparent;
    border: 1px solid var(--line-2); border-radius: 8px; cursor: pointer;
  }
  .nav-toggle span { display: block; height: 2px; width: 100%; background: var(--txt-dim); border-radius: 2px; transition: transform .2s, opacity .2s; }
  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

  .nav-links {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0; align-items: stretch;
    background: rgba(243,246,250,0.98); backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line); padding: 6px 0;
    transform: translateY(-8px); opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity .2s, transform .2s, visibility .2s;
  }
  .nav-links.open { transform: none; opacity: 1; visibility: visible; pointer-events: auto; }
  .nav-links a { padding: 13px 32px; font-size: 15px; }
  .nav-links a.active::after { display: none; }   /* underline awkward when stacked */
  .nav-links a.active { box-shadow: inset 3px 0 0 var(--accent); }

  .radar-app { grid-template-columns: 1fr; }
  .radar-stage { grid-template-columns: 1fr; }
  .framework { grid-template-columns: 1fr; }
  .layer-detail { position: static; }
  .hypos { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; }
  .hero-stats, .research-grid, .invite-grid { grid-template-columns: 1fr; }
}

/* ===== higher contrast on request: darken secondary text, strengthen borders ===== */
@media (prefers-contrast: more) {
  :root {
    --txt-dim: #2f3b4d;
    --txt-faint: #3c4a5e;
    --line: #b3bfce;
    --line-2: #8d9cb0;
  }
  .btn-ghost { border-color: var(--accent-d); }
  .nav { border-bottom-color: var(--line-2); }
}

/* ===== reduced motion: kill page/hover/transition motion (radar loop handled in JS) ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .page.active { animation: none; }
  .layer:hover, .hypo:hover, .icard:hover, .rcard:hover,
  .btn:hover, .hero-stats > div:hover { transform: none; }
}
