/* Atlas static pages. Editorial direction shared with the story map: warm paper, ink, and two
   semantic accents (Asian = teal, Hispanic/Latino = burnt orange). No inline styles anywhere:
   the pages are served under a CSP without 'unsafe-inline'. */
@font-face { font-family: "Inter"; font-weight: 400; font-display: swap;
  src: url("fonts/inter-latin-regular.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 700; font-display: swap;
  src: url("fonts/inter-latin-bold.woff2") format("woff2"); }

:root {
  --paper: #f6f2ea; --paper-deep: #ece6da; --ink: #1d1b18; --ink-soft: #4a463f; --muted: #6f6a61;
  --rule: #d9d2c4; --asian: #0f6670; --hispanic: #b8501a; --focus: #0f6670;
  --text-base: clamp(1rem, 0.94rem + 0.3vw, 1.125rem);
  --text-h1: clamp(2.25rem, 1.2rem + 4.2vw, 4.25rem);
  --text-h2: clamp(1.35rem, 1.1rem + 1vw, 1.75rem);
  --space-section: clamp(3rem, 2rem + 4vw, 6rem);
  --measure: 40rem;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--paper); color: var(--ink); font: 400 var(--text-base)/1.6 var(--font);
  -webkit-text-size-adjust: 100%; text-rendering: optimizeLegibility; }
body { margin: 0; }
:lang(zh-CN) body { line-height: 1.8; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 2px; }
img { max-width: 100%; height: auto; display: block; }
main { padding: 0 clamp(1.25rem, 4vw, 3rem); max-width: 76rem; margin: 0 auto; }

/* ---- header / footer */
.site-head { display: flex; align-items: baseline; gap: 0.6rem; padding: 1.1rem clamp(1.25rem, 4vw, 3rem);
  border-bottom: 1px solid var(--rule); font-size: 0.95rem; }
.site-head .home, .site-head .brand { font-weight: 700; text-decoration: none; }
.site-head .sep { color: var(--rule); }
.site-head .atlas { text-decoration: none; color: var(--ink-soft); }
.site-head nav { margin-left: auto; display: flex; gap: 1.4rem; }
.site-head nav a { text-decoration: none; color: var(--ink-soft); }
.site-head nav a:hover { color: var(--ink); text-decoration: underline; }
.site-foot { margin-top: var(--space-section); padding: 2rem clamp(1.25rem, 4vw, 3rem) 3rem;
  border-top: 1px solid var(--rule); color: var(--muted); font-size: 0.85rem; }
.site-foot p { margin: 0.3rem 0; max-width: var(--measure); }

/* ---- type */
h1 { font-size: var(--text-h1); line-height: 1.02; letter-spacing: -0.03em; font-weight: 700; margin: 0; }
:lang(zh-CN) h1 { letter-spacing: 0; line-height: 1.2; }
h2 { font-size: var(--text-h2); line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 1rem; }
h3 { font-size: 1.05rem; margin: 0 0 0.35rem; }
.kicker { text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.75rem; font-weight: 700;
  color: var(--asian); margin: 0 0 1rem; }
.lede, .dek { font-size: clamp(1.15rem, 1rem + 0.7vw, 1.45rem); line-height: 1.45; color: var(--ink-soft);
  max-width: 44rem; margin: 1.5rem 0 0; }
.prose { max-width: var(--measure); }
.prose p, .prose li { color: var(--ink-soft); }

/* ---- buttons */
.cta { display: inline-flex; align-items: center; gap: 0.5rem; margin-top: 2rem; padding: 0.85rem 1.4rem;
  background: var(--ink); color: var(--paper); text-decoration: none; font-weight: 700; border-radius: 999px;
  transition: transform 150ms var(--ease), background-color 150ms var(--ease); }
.cta span { transition: transform 300ms var(--ease); }
.cta:hover { background: var(--asian); text-decoration: none; }
.cta:hover span { transform: translateX(4px); }
.cta:active { transform: scale(0.98); }

/* ---- landing */
.hero { padding: var(--space-section) 0 calc(var(--space-section) * 0.6); max-width: 58rem; }
.featured { margin-bottom: var(--space-section); }
.story-card { display: grid; gap: 0.5rem; text-decoration: none; padding: clamp(0.75rem, 2vw, 1.25rem);
  background: #fffdf8; border: 1px solid var(--rule); border-radius: 6px;
  box-shadow: 0 1px 0 var(--rule), 0 18px 40px -28px rgba(29, 27, 24, 0.45);
  transition: transform 300ms var(--ease), box-shadow 300ms var(--ease); }
.story-card:hover { transform: translateY(-3px); box-shadow: 0 1px 0 var(--rule), 0 28px 50px -30px rgba(29, 27, 24, 0.55); }
.story-card img { border-radius: 3px; }
.story-title { font-size: var(--text-h2); font-weight: 700; line-height: 1.2; margin-top: 0.75rem; }
.story-dek { color: var(--ink-soft); max-width: 44rem; }
.features ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 2rem 3rem;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.features li { border-top: 3px solid var(--ink); padding-top: 1rem; }
.features li:nth-child(even) { border-top-color: var(--hispanic); }
.features li p { margin: 0; color: var(--ink-soft); }
.features, .landing .prose { margin-bottom: var(--space-section); }

/* ---- story */
.story-head { padding: var(--space-section) 0 2rem; max-width: 58rem; }
.byline { color: var(--muted); font-size: 0.9rem; margin: 1.5rem 0 0; }
.hero-map { margin: 0 calc(-1 * clamp(0rem, 2vw, 1.5rem)) 3rem; }
.hero-map img { border: 1px solid var(--rule); border-radius: 4px; }
.story section { margin-top: var(--space-section); }
.findings { padding-left: 1.2rem; }
.findings li { margin-bottom: 0.75rem; }
.findings li::marker { color: var(--hispanic); }
.fam { margin: 2.5rem 0 0.75rem; display: flex; align-items: center; gap: 0.5rem; }
.fam::before { content: ""; width: 0.8rem; height: 0.8rem; border-radius: 50%; background: currentColor; }
.fam-asian { color: var(--asian); } .fam-hispanic { color: var(--hispanic); }
.table-wrap { overflow-x: auto; border-top: 2px solid var(--ink); }
/* Wide enough that no column is squeezed (CJK text would otherwise wrap one character per line);
   narrow screens scroll the table sideways with the group name pinned. */
table { border-collapse: collapse; width: 100%; min-width: 50rem; font-size: 0.92rem; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 0.6rem 0.9rem 0.6rem 0; border-bottom: 1px solid var(--rule); vertical-align: baseline; }
thead th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 700; }
:lang(zh-CN) thead th { text-transform: none; letter-spacing: 0; font-size: 0.8rem; }
tbody th { font-weight: 700; white-space: nowrap; position: sticky; left: 0; background: var(--paper);
  padding-left: 0.1rem; box-shadow: 1px 0 0 var(--rule); }
tbody td:nth-child(2), tbody td:nth-child(6), tbody td:last-child { white-space: nowrap; }
td.n { text-align: right; white-space: nowrap; }
td small { color: var(--muted); }
tbody tr:hover, tbody tr:hover th { background: var(--paper-deep); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1.5rem; margin-top: 1.5rem; }
.actions .cta { margin-top: 0; }
.method li { margin-bottom: 0.6rem; }
/* third-party data credit under a page's method list (licence-required wording) */
.credit { color: var(--ink-soft); font-size: 0.9rem; border-left: 3px solid var(--rule); padding-left: 0.8rem; }
.disclaimer { margin-top: var(--space-section); max-width: var(--measure); padding: 1.25rem 1.5rem;
  border-left: 4px solid var(--hispanic); background: var(--paper-deep); }
.disclaimer h2 { font-size: 1rem; margin-bottom: 0.4rem; }
.disclaimer p { margin: 0; color: var(--ink-soft); }

@media (max-width: 40rem) {
  .site-head { flex-wrap: wrap; }
  .site-head nav { width: 100%; margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

/* ---- /labs/ index */
.labs .hero { padding-bottom: 2rem; }
.projects { margin-bottom: var(--space-section); }
.project { display: grid; grid-template-columns: minmax(0, 3fr) minmax(16rem, 2fr); gap: clamp(1.25rem, 3vw, 2.5rem);
  align-items: center; text-decoration: none; padding: clamp(0.75rem, 2vw, 1.25rem); background: #fffdf8;
  border: 1px solid var(--rule); border-radius: 6px;
  box-shadow: 0 1px 0 var(--rule), 0 18px 40px -28px rgba(29, 27, 24, 0.45);
  transition: transform 300ms var(--ease), box-shadow 300ms var(--ease); }
.project:hover { transform: translateY(-3px); box-shadow: 0 1px 0 var(--rule), 0 28px 50px -30px rgba(29, 27, 24, 0.55); }
.project img { border-radius: 3px; }
.project-body { display: grid; gap: 0.75rem; }
.project-name { font-size: var(--text-h2); font-weight: 700; letter-spacing: -0.01em; }
.project-blurb { color: var(--ink-soft); }
.project-cta { font-weight: 700; color: var(--asian); }
.project-cta span { display: inline-block; transition: transform 300ms var(--ease); }
.project:hover .project-cta span { transform: translateX(4px); }
@media (max-width: 48rem) { .project { grid-template-columns: 1fr; } }

/* ---- landing: more stories under the featured one */
.story-grid { display: grid; gap: 1.5rem; margin-top: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); }
.story-grid .story-title { font-size: 1.2rem; }
.story-grid .story-dek { font-size: 0.95rem; }

/* ---- by-state story: in-body map figures + tie notes in the table */
.hero-map figcaption h2 { margin: 0 0 1rem; }
table.states { min-width: 56rem; }
table.states td { white-space: normal; }
small.close { color: var(--hispanic); }

/* ---- socal story: table headings in the compare-mode colours of its map */
.fam-chinese { color: #2a78d6; } .fam-vietnamese { color: #eb6834; }
