/* ===== Tokens ===== */
:root {
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-short: 200ms;
  --dur-base: 280ms;
  --dur-reveal: 380ms;
  --maxw: 960px;

  /* Palette defaults — per-page CSS overrides these */
  --bg: #ffffff;
  --fg: #222;
  --fg-2: #555;
  --fg-3: #888;
  --hairline: #e5e1d8;
  --accent: #4a9eff;
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.55;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; background: none; border: 0; cursor: pointer; color: inherit; padding: 0; }

/* ===== Focus rings ===== */
:focus { outline: none; }
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

/* ===== Language-aware font stacks ===== */
:root,
html[lang="en"] body { font-family: "Inter", "Noto Sans SC", "Noto Sans JP", -apple-system, BlinkMacSystemFont, sans-serif; }
html[lang="zh"] body { font-family: "Inter", "Noto Sans SC", -apple-system, sans-serif; }
html[lang="ja"] body { font-family: "Inter", "Noto Sans JP", -apple-system, sans-serif; }

/* Pages can opt into serif via body class (see life.css) */

/* ===== Navbar ===== */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px;
  backdrop-filter: blur(10px);
  background: rgba(255,255,255,0.72);
  border-bottom: 1px solid var(--hairline);
  font-size: 12px; letter-spacing: 1.5px;
  z-index: 100;
}
.nav__brand { font-weight: 500; color: var(--fg); }
.nav__links { display: flex; gap: 22px; }
.nav__links a { color: var(--fg-2); transition: color var(--dur-short) var(--ease); }
.nav__links a:hover { color: var(--fg); }
.nav__links a.is-active { color: var(--fg); border-bottom: 1px solid var(--fg); padding-bottom: 2px; }
.nav__volumes { display: flex; gap: 14px; font-size: 12px; }
.nav__volumes a { color: var(--fg-3); transition: color var(--dur-short) var(--ease); }
.nav__volumes a:hover { color: var(--fg); }
.nav__volumes a.is-active { color: var(--fg); font-weight: 500; border-bottom: 1px solid var(--fg); padding-bottom: 2px; }
.nav__langs { display: flex; gap: 10px; font-size: 11px; }
.nav__langs button { color: var(--fg-3); transition: color var(--dur-short) var(--ease); }
.nav__langs button.is-active { color: var(--fg); font-weight: 600; }

/* ===== Footer ===== */
.footer {
  border-top: 1px solid var(--hairline);
  padding: 30px 28px 40px;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; color: var(--fg-3); letter-spacing: 1px;
}
.footer a { color: var(--fg-2); border-bottom: 1px solid transparent; transition: border-color var(--dur-short) var(--ease); }
.footer a:hover { border-color: var(--fg-2); }
.footer__wechat { position: relative; cursor: pointer; }
.footer__wechat-pop {
  display: none; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: #fff; border: 1px solid var(--hairline); padding: 10px; border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.12); z-index: 201;
}
.footer__wechat-pop img { max-width: 60vw; max-height: 60vh; width: auto; height: auto; }
.wechat-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.3); z-index: 200;
}
@media (hover: hover) {
  .footer__wechat:hover .footer__wechat-pop { display: block; }
}
.footer__wechat.is-open .footer__wechat-pop,
.footer__wechat.is-open + .wechat-overlay { display: block; }

/* ===== Main layout ===== */
main { padding-top: 54px; /* clear fixed nav */ }
.section { max-width: var(--maxw); margin: 0 auto; padding: 80px 28px; }
.section__label { font-size: 11px; letter-spacing: 3px; color: var(--fg-3); margin: 0 0 14px; text-transform: uppercase; }
.section__heading { font-size: 32px; margin: 0 0 12px; font-weight: 400; letter-spacing: -0.5px; }
.section__subtitle { color: var(--fg-2); margin: 0 0 32px; font-size: 14px; }

/* ===== Motion utilities ===== */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity var(--dur-reveal) var(--ease), transform var(--dur-reveal) var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }
body.is-leaving { opacity: 0; transition: opacity 240ms var(--ease); }
body { transition: opacity 320ms var(--ease); }

/* Hover lift */
.lift { transition: transform var(--dur-short) var(--ease), box-shadow var(--dur-short) var(--ease); }
.lift:hover { transform: translateY(-4px); box-shadow: 0 10px 24px rgba(0,0,0,0.08); }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .nav { padding: 10px 16px; }
  .nav__links { gap: 14px; }
  .section { padding: 56px 20px; }
  .section__heading { font-size: 26px; }
  .footer { flex-direction: column; gap: 10px; padding: 24px 16px 30px; }
}
