/* Base — reset, typography, utilities, focus, motion primitives, reduced motion.
   Lining figures on every element: `font:` shorthands reset inherited feature settings (Cormorant is old-style). */
*, *::before, *::after { box-sizing: border-box; font-feature-settings: "lnum" 1 !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 32px); scrollbar-color: var(--gold-4) var(--ink-0); background: var(--ink-1); }
body { margin: 0; min-height: 100vh; background: var(--ink-1); color: var(--ivory); font: 400 var(--fs-md)/var(--lh-body) var(--font-ui); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; font-kerning: normal; }
/* Material: warm vignette + fine grain (decorative, fixed, never intercepts input) */
body::before, body::after { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; }
body::before { background: radial-gradient(1200px 700px at 78% -8%, rgba(226,194,122,.07), transparent 60%), radial-gradient(900px 600px at -10% 30%, rgba(122,162,255,.03), transparent 60%), linear-gradient(180deg, var(--ink-1), var(--ink-0) 120%); }
body::after { opacity: .045; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 .95 0 0 0 0 .85 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }

img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
ul, ol { margin: 0; padding: 0; }
p, figure, blockquote, dl, dd { margin: 0; }
[hidden] { display: none !important; }
table { border-collapse: collapse; }
::selection { background: rgba(226,194,122,.32); color: #fff; }

/* ---- Typography: heavy sans display (CJK falls back to PingFang / JhengHei / Noto Sans TC bold) ---- */
h1, h2, h3, h4, h5 { margin: 0; font-family: var(--font-display); font-weight: 700; line-height: var(--lh-tight); letter-spacing: -.01em; color: var(--ivory); text-wrap: balance; word-break: keep-all; /* CJK headings break at punctuation, not mid-word */ overflow-wrap: anywhere; /* …but never overflow */ }
:lang(zh) :is(h1, h2, h3, h4, h5) { letter-spacing: .01em; }
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); }
p { text-wrap: pretty; }
strong, b { font-weight: 600; }
small { font-size: var(--fs-sm); }

.display { font-family: var(--font-display); font-weight: 700; line-height: 1.06; font-size: var(--fs-display); letter-spacing: -.02em; }
.serif { font-family: var(--font-serif); }
.num, .mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums lining-nums; letter-spacing: -.01em; }
.foil-text, .grad-text { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }
.lead { font-size: var(--fs-lg); line-height: 1.75; color: var(--stone); max-width: 56ch; }
.muted { color: var(--stone); }
.faint { color: var(--text-3); }
.pos { color: var(--jade); }
.neg { color: var(--garnet); }
.flat { color: var(--stone); }
.caps { text-transform: uppercase; letter-spacing: var(--tracking-caps); font-size: var(--fs-xs); font-weight: 600; }

.eyebrow { display: inline-flex; align-items: center; gap: 10px; font: 600 var(--fs-xs)/1.2 var(--font-ui); letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--gold-2); }
.eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--gold-2); box-shadow: 0 0 0 4px rgba(226,194,122,.14); }
.eyebrow__no { font-family: var(--font-mono); font-size: .75rem; letter-spacing: .06em; color: var(--gold-3); }

.prose { color: var(--stone); line-height: 1.85; }
.prose a { color: var(--gold-2); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(226,194,122,.4); }
.prose a:hover { text-decoration-color: currentColor; }

/* ---- Layout ---- */
.container { width: 100%; max-width: calc(var(--container) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
.section { position: relative; padding-block: var(--section-y); }
.section--tight { padding-block: calc(var(--section-y) * .6); }
.section-head { display: grid; gap: var(--s-4); margin-bottom: clamp(32px, 3.6vw, 56px); max-width: 780px; }
.section-head--split { max-width: none; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: var(--s-6); }
.section-head--center { margin-inline: auto; text-align: center; justify-items: center; }
.section-title { font-size: var(--fs-h2); }
.section-sub { color: var(--stone); font-size: var(--fs-lg); line-height: 1.7; max-width: 60ch; }
@media (max-width: 767px) {
  .section-head--split { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .section-sub { font-size: var(--fs-md); }
}

/* ---- Accessibility ---- */
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--gold-1); outline-offset: 3px; border-radius: 4px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 16px; top: -80px; z-index: var(--z-toast); padding: 12px 18px; border-radius: var(--r-sm); background: var(--foil); color: var(--ink-0); font-weight: 600; transition: top var(--dur-2) var(--ease); }
.skip-link:focus-visible { top: 16px; }

/* ---- Motion primitives (core/motion.js) — JS only ever adds the "pending" states to content below the fold ---- */
.reveal-pending { opacity: 0; transform: translate3d(0, 22px, 0); }
.reveal-pending:focus-within { opacity: 1; transform: none; }
.reveal-in { opacity: 1; transform: none; transition: opacity var(--dur-reveal) var(--ease-out), transform var(--dur-reveal) var(--ease-out); transition-delay: calc(var(--ri, 0) * 70ms); }
[data-countup] { display: inline-block; font-variant-numeric: tabular-nums; }
.fill-pending [data-fill-bar], .fill-pending[data-fill-bar] { transform: scaleX(0) !important; }
[data-fill-bar] { transform-origin: left center; transition: transform 1.1s var(--ease-out) .1s; }
/* Offscreen sections keep their frame, not their CPU; the footer "pause animations" toggle (app.js) freezes every loop (WCAG 2.2.2) */
.is-offscreen, .is-offscreen *, .is-offscreen *::before, .is-offscreen *::after, .is-offscreen::before, .is-offscreen::after, :root[data-motion="off"] *, :root[data-motion="off"] *::before, :root[data-motion="off"] *::after { animation-play-state: paused !important; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes float-y { 0%, 100% { transform: translate3d(0, 0, 0); } 50% { transform: translate3d(0, -12px, 0); } }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes pulse-ring { 0% { transform: scale(.6); opacity: .7; } 100% { transform: scale(1.9); opacity: 0; } }
@keyframes sheen { 0%, 62% { transform: translateX(-130%) skewX(-18deg); } 82%, 100% { transform: translateX(230%) skewX(-18deg); } }
@keyframes dash-flow { to { stroke-dashoffset: -48; } }
@keyframes aurora-a { 0%, 100% { transform: translate3d(-8%, -4%, 0) scale(1); } 50% { transform: translate3d(10%, 6%, 0) scale(1.18); } }
@keyframes aurora-b { 0%, 100% { transform: translate3d(6%, 4%, 0) scale(1.1); } 50% { transform: translate3d(-12%, -6%, 0) scale(.92); } }

@media (max-width: 1023px) { html { scroll-padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 16px); } }
/* Windows contrast themes: gradient-clipped text would lose its fill */
@media (forced-colors: active) { .foil-text, .grad-text, .stat__value, .lp-stat dd b { background: none !important; color: CanvasText !important; -webkit-text-fill-color: currentColor !important; } }

/* ---- Scrollbars ---- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--ink-0); }
::-webkit-scrollbar-thumb { background: #3a3222; border-radius: 10px; border: 2px solid var(--ink-0); }
::-webkit-scrollbar-thumb:hover { background: var(--gold-4); }

/* ---- Reduced motion: no motion at all, every piece of content in its final visible state (SPEC §9) ---- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal-pending { opacity: 1; transform: none; }
  .fill-pending [data-fill-bar], .fill-pending[data-fill-bar] { transform: none !important; }
}
