/* Shared foundation for suhstainability.com: design tokens, base elements, focus, the site
   header and footer. Each page adds its own layout CSS inline. Same-origin file, system fonts
   only, so pages still load quickly in mainland China. */
:root {
  --paper: #ffffff; --ink: #0e1513; --muted: #5a6561; --line: #e2e7e4; --tint: #f3f6f4; --cell0: #f3f6f4;
  --hl: #ffd23f; --hl-ink: #0e1513; --deep: #0c2f29; --on-deep: #f3f7f5; --accent: #1d6a56;
  --scrim: rgba(6, 14, 12, 0.72);
  --display: "Avenir Next", "Avenir", "Helvetica Neue", "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --body: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", Roboto, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --mega: clamp(2.8rem, 1.2rem + 6.6vw, 7rem);
  --huge: clamp(2.1rem, 1rem + 4.4vw, 4.8rem);
  --big: clamp(1.5rem, 1rem + 2vw, 2.4rem);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --paper: #0b100f; --ink: #eef3f1; --muted: #9fb0aa; --line: #22302c; --tint: #121a18; --cell0: #16201d; --deep: #103a33; --accent: #55c29d; color-scheme: dark; }
}
:root[data-theme="dark"] { --paper: #0b100f; --ink: #eef3f1; --muted: #9fb0aa; --line: #22302c; --tint: #121a18; --cell0: #16201d; --deep: #103a33; --accent: #55c29d; color-scheme: dark; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1.05rem/1.6 var(--body); -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
p { margin: 0; }
h1, h2, h3 { margin: 0; }
.wrap { max-width: 78rem; margin-inline: auto; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }

/* Keyboard focus: dark ring plus yellow halo, visible on light and dark backgrounds */
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; box-shadow: 0 0 0 6px var(--hl); border-radius: 4px; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; padding: .6rem .9rem; border-radius: 8px; background: var(--hl); color: var(--hl-ink); font-weight: 700; text-decoration: none; }
.skip:focus { top: 12px; }

/* Highlighter. On dark surfaces the highlight becomes yellow text instead of a stripe. */
mark { background: linear-gradient(transparent 58%, var(--hl) 58%, var(--hl) 92%, transparent 92%); color: inherit; padding: 0 .06em; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) mark { background: none; color: var(--hl); padding: 0; } }
:root[data-theme="dark"] mark { background: none; color: var(--hl); padding: 0; }

/* Site header */
.site-top { position: relative; z-index: 5; color: var(--ink); }
.site-top.inverse { color: #fff; }
.site-top.overlay { position: absolute; inset: 0 0 auto; }
.site-top .wrap { display: flex; align-items: center; justify-content: space-between; gap: .6rem 1.2rem; flex-wrap: wrap; padding-block: .9rem; }
.site-top .brand { font: 800 1rem/1 var(--display); letter-spacing: -0.02em; text-decoration: none; padding: .45rem 0; }
.site-top .brand b { font-weight: 800; color: inherit; }
.site-top nav { display: flex; gap: 1.1rem; }
.site-top nav a { font: 600 .92rem/1 var(--body); text-decoration: none; padding: .45rem 0; border-bottom: 2px solid transparent; }
.site-top nav a:hover { border-bottom-color: currentColor; }
.site-top nav a[aria-current="page"] { border-bottom-color: var(--hl); }
.site-top.inverse { text-shadow: 0 1px 8px rgba(0,0,0,.35); }
@media (max-width: 380px) { .site-top nav { gap: .8rem; } .site-top nav a { font-size: .86rem; } }

/* Site footer */
.site-foot { background: #06100d; color: #c6d2cd; padding-block: 2.4rem 3rem; font-size: .88rem; line-height: 1.55; }
.site-foot .wrap { display: grid; gap: .7rem; }
.site-foot a { color: #fff; }
.site-foot nav { display: flex; flex-wrap: wrap; gap: .3rem 1.1rem; padding-bottom: .9rem; border-bottom: 1px solid #1e2a26; }
.site-foot nav a { font-weight: 600; text-decoration: none; padding: .3rem 0; }
.site-foot nav a:hover { text-decoration: underline; text-decoration-color: var(--hl); }
.site-foot b { color: #fff; }
