/* Base: reset, type, layout primitives. Tokens live in tokens.css. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--t-md);
  line-height: 1.55;
  font-stretch: 100%;
  font-weight: 400;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
html[lang^="zh"] body { font-family: var(--font), var(--font-zh); line-height: 1.75; }

img, svg, video { display: block; max-width: 100%; }
a { color: var(--link); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 2px; }
button { font: inherit; color: inherit; }
::selection { background: color-mix(in srgb, var(--orange) 35%, transparent); }

h1, h2, h3, h4 { margin: 0; color: var(--ink); text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; }

/* Display type: condensed, heavy — reads like aisle signage and pallet labels. */
.display, h1, h2 {
  font-stretch: 72%;
  font-weight: 800;
  letter-spacing: -0.012em;
  line-height: 1.02;
}
h1 { font-size: var(--t-hero); }
h2 { font-size: var(--t-3xl); }
h3 { font-size: var(--t-xl); font-stretch: 88%; font-weight: 700; line-height: 1.15; letter-spacing: -0.005em; }
h4 { font-size: var(--t-lg); font-weight: 650; line-height: 1.25; }
html[lang^="zh"] h1, html[lang^="zh"] h2 { letter-spacing: 0.01em; line-height: 1.2; font-weight: 800; }
/* Big Chinese headings (heroes, section titles, step titles) break at punctuation and spaces, not inside a word (「客｜户」).
   A run too long for the line still breaks (overflow-wrap: anywhere also keeps it from widening the page). Longer
   titles elsewhere (film titles) keep the normal Chinese line breaking. */
html[lang^="zh"] :is(.hero h1, .section-head h2, .steps h3, .way h3) { word-break: keep-all; overflow-wrap: anywhere; }
html[lang^="zh"] h3 { line-height: 1.35; }

.lead { font-size: var(--t-lg); color: var(--ink-2); max-width: 38em; line-height: 1.5; }
.muted { color: var(--ink-2); }
.small { font-size: var(--t-sm); }
.fine { font-size: var(--t-xs); color: var(--ink-3); line-height: 1.45; }
.prose p + p { margin-top: var(--s-4); }
.prose { max-width: 40em; }

/* Layout */
.wrap { width: 100%; max-width: calc(var(--wrap) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding-block: var(--s-9); }
.section--tight { padding-block: var(--s-8); }
.section--mist { background: var(--bg-2); }
.section--band { background: var(--band-bg); color: var(--band-ink); }
.section--band h1, .section--band h2, .section--band h3, .section--band h4 { color: var(--band-ink); }
.section--band .muted, .section--band .lead { color: var(--band-ink-2); }
.section--band a { color: #8CC4F2; }
.section-head { display: grid; gap: var(--s-4); margin-bottom: var(--s-7); max-width: 46rem; }

.grid { display: grid; gap: var(--s-6); }
@media (min-width: 760px) {
  .grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1080px) {
  .grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.skip-link { position: absolute; left: var(--s-4); top: -4rem; z-index: 100; background: var(--ink); color: var(--bg); padding: var(--s-2) var(--s-4); border-radius: var(--r-sm); }
.skip-link:focus { top: var(--s-4); }

[id] { scroll-margin-top: 5.5rem; }
