/* Research journal theme, navigation, and landing composition.
 * Exports: shared tokens and layout classes. Deps: chrome.py and pages.py. */
:root {
  --green: #86e7b8;
  --green-dim: #70cda2;
  --cyan: #86e7b8;
  --bg: #101513;
  --bg-block: #18201c;
  --border: #35453c;
  --text: #e7ece8;
  --text-dim: #a2afa6;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
html[data-theme="light"] {
  --green: #17633f;
  --green-dim: #245d40;
  --cyan: #17633f;
  --bg: #f5f4ee;
  --bg-block: #eaece4;
  --border: #b7c1b5;
  --text: #202b24;
  --text-dim: #59655d;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; color-scheme: dark; scroll-padding-top: 9rem; }
html[data-theme="light"] { color-scheme: light; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.65 var(--font); }
::selection { background: var(--green); color: var(--bg); }
a { color: var(--green); text-decoration: none; text-underline-offset: 4px; }
a:hover { text-decoration: underline; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 4px; }
h1, h2, h3 { font-weight: 600; line-height: 1.18; letter-spacing: -.035em; }
.text-dim { color: var(--text-dim); }
.site-shell { min-height: 100svh; display: flex; flex-direction: column; }
.site-nav { border-bottom: 1px solid var(--border); background: var(--bg); }
.site-nav-inner {
  display: flex; align-items: center; gap: 24px; max-width: 1200px;
  margin: auto; min-height: 80px; padding: 12px 32px;
}
.site-brand { color: var(--text); font-size: 21px; font-weight: 650; letter-spacing: -.05em; white-space: nowrap; }
.site-brand span { color: var(--green); }
.site-brand:hover { text-decoration: none; }
.nav-link { color: var(--text-dim); font-size: 14px; min-height: 44px; display: inline-flex; align-items: center; }
.nav-tools { margin-left: auto; display: flex; gap: 12px; align-items: center; }
.seg { display: flex; gap: 2px; }
.seg button {
  background: transparent; border: 1px solid transparent; border-radius: 6px;
  color: var(--text-dim); font: 12px var(--mono); min-height: 44px; min-width: 44px;
  padding: 0 9px; cursor: pointer; transition: background .18s, color .18s;
}
.seg button[aria-pressed="true"] { color: var(--green); border-color: var(--border); background: var(--bg-block); }
.seg button:hover { color: var(--text); background: var(--bg-block); }
main { width: 100%; flex: 1; }
.site-footer {
  max-width: 1136px; width: calc(100% - 64px); margin: 64px auto 0; padding: 24px 0;
  border-top: 1px solid var(--border); color: var(--text-dim); font-size: 13px;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.site-footer a { color: var(--text); min-height: 44px; display: inline-flex; align-items: center; }
.footer-links { display: flex; gap: 24px; }
.landing-intro { max-width: 1200px; margin: auto; padding: 48px 32px 32px; }
.eyebrow, .kicker { font: 12px/1.5 var(--mono); letter-spacing: .07em; color: var(--text-dim); }
.wordmark { margin: 0; font-size: clamp(32px, 4.5vw, 56px); line-height: 1.12; letter-spacing: -.05em; }
.mission { margin: 16px 0 0; color: var(--text-dim); max-width: 40rem; font-size: 18px; }
.topic-card { display: block; color: inherit; }
.topic-card:hover { text-decoration: none; }
.topic-visual, .hero-visual { position: relative; overflow: hidden; background: #10232a; color: #e7eeeb; }
.topic-visual { min-height: 500px; }
.topic-visual > img, .hero-art {
  position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; object-position: center;
}
.topic-copy, .hero-copy {
  position: relative; margin-left: 48%; width: 52%; padding: 72px max(32px, calc((100vw - 1136px) / 2)) 72px 48px;
  min-height: inherit; display: flex; flex-direction: column; justify-content: center;
  background: linear-gradient(90deg, #10232a00, #10232ae8 12%, #10232afa 100%);
}
.topic-copy time, .hero-copy .kicker { color: #b5c9c3; font: 12px/1.5 var(--mono); letter-spacing: .04em; }
.topic-copy h2 { color: #ebf4ef; font-size: clamp(30px, 3.4vw, 48px); margin: 20px 0; max-width: 12ch; }
.topic-copy p { color: #c3d6ce; font-size: 18px; max-width: 32ch; margin: 0; }
.read-link { display: inline-flex; align-items: center; min-height: 44px; margin-top: 28px; color: #a0f3c9; font-size: 14px; gap: 16px; }
.read-link span { transition: transform .2s; }
.topic-card:hover .read-link span { transform: translateX(5px); }
.topic-meta { max-width: 1200px; margin: auto; padding: 20px 32px; display: flex; gap: 16px; color: var(--text-dim); font: 12px/1.5 var(--mono); }
.hero-copy > *, .topic-copy > * { animation: enter .5s ease-out both; }
.hero-copy > :nth-child(3), .topic-copy > :nth-child(3) { animation-delay: .08s; }
@keyframes enter { from { transform: translateY(8px); } to { transform: none; } }
html[data-lang="en"] .lang-zh, html:not([data-lang]) .lang-zh, html[data-lang="zh"] .lang-en { display: none; }
.skip-link { position: fixed; top: -80px; left: 16px; z-index: 50; background: var(--bg); padding: 12px; }
.skip-link:focus { top: 12px; }
@media (max-width: 760px) {
  .site-nav-inner { padding: 12px 20px; gap: 12px; min-height: 72px; flex-wrap: wrap; }
  .site-brand { font-size: 19px; }
  .nav-link { display: none; }
  .nav-tools { gap: 4px; }
  .seg button { padding: 0 7px; }
  .landing-intro { padding: 32px 20px 28px; }
  .mission { font-size: 16px; max-width: 30ch; }
  .topic-visual { min-height: 0; }
  .topic-visual > img, .hero-art { position: static; height: 210px; object-position: 30% 42%; }
  .topic-copy, .hero-copy { margin: 0; width: 100%; padding: 24px 20px 28px; background: #10232a; }
  .topic-copy h2 { margin: 12px 0; font-size: 32px; max-width: 18ch; }
  .topic-copy p { font-size: 16px; max-width: 38ch; }
  .read-link { margin-top: 12px; }
  .topic-meta { padding: 16px 20px; flex-wrap: wrap; gap: 8px 16px; }
  .site-footer { width: calc(100% - 40px); margin-top: 40px; }
}
@media (max-width: 420px) {
  .site-nav-inner { column-gap: 8px; }
  .site-nav:has([data-lang-btn]) .nav-tools { width: 100%; justify-content: space-between; }
  .site-nav:has([data-lang-btn]) .site-nav-inner { padding-top: 10px; padding-bottom: 8px; row-gap: 6px; }
  .topic-visual > img, .hero-art { height: 170px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
